This is a blank 'hello world' FeedHenry MBaaS. Use it as a starting point for building your APIs.
'Hello world' endpoint.
-
Request (application/json)
- Body { "hello": "world" }
-
Response 200 (application/json)
- Body { "msg": "Hello world" }
npm installIn order to run the Hello World server locally you'll need to have MongoDB installed and running on your local machine.
Start MongoDB server with:
mongodThe Hello World server will try to access MongoDB on the default port 27017, if you are running MongoDB on a different port you should set the FH_MONGODB_CONN_URL environment variable to the MongoDB connection URL.
In order to run the Hellow World server locally you'll need to have Redis installed and running on your local machine.
Start Redis server with:
redis-server /usr/local/etc/redis.confnpm run serveThe Hello World server will be availble at localhost:8001.
If you wish to run the server on a different port you should set the FH_PORT
environment variable to the port you want the server to run on.
npm run debugVisit http://127.0.0.1:8080/?port=5858 to start debugging.
See Cloud Development page about how to develop cloud app.
All the tests are in the "test/" directory. The cloud app is using mocha as the test runner.
- all the tests:
With MongoDB and Redis running
npm test- unit tests:
npm run unit- acceptance tests:
With MongoDB and Redis running
npm run acceptnpm run coverage- coverage report for unit tests:
npm run coverage-unit- coverage report for acceptance tests:
npm run coverage-acceptTo get Plato's JavaScript source code visualization, static analysis, and complexity report:
npm run analysis