Demo Stackato mongo app
This application has 2 API endpoints:
This just reads data from the database and returns it.
Example:
$ curl http://stackato-mongo.192.168.77.1.nip.io/read
[
{
"id": "5801156b50bf89e3d14c3587",
"user": "lozethghsj",
"email": "[email protected]",
"password": "mvzloqkbvz"
}
]
This will write an entry with random data into the database and return the data it inserted.
Example:
$ curl -X POST http://stackato-mongo.192.168.77.1.nip.io/write
{
"id": "",
"user": "lozethghsj",
"email": "[email protected]",
"password": "mvzloqkbvz"
}
To deploy this application you can just do cf push
Requires HCF to have 1 service called stackato-mongo
This application will work with local mongo.
To make this service available follow these steps:
hsm create-instance stackato.hpe.mongo 3.0
- enter the instance name as
stackato-mongo
cf hsm enable-service-instance stackato-mongo stackato-mongo
- make sure to add all the endpoints to the security group
cf create-service stackato-mongo default stackato-mongo