Please create a simple "Hello World" API. Meaning:
-
It should be a RESTful JSON API that listens on a port of your choice.
-
When someone posts anything to the route /hello, you should return a welcome message, in JSON format. This message can be anything you want.
RESTful JSON API that listens to port 8080 on staging and on port 5000 on production, which only valid path is /hello. It should return 200 status code and an object with two key values properties:
- First key = "msg" and value a welcome msg
- Seconde key = "post" and a value containing the clients post
If you try with another route it will return a 404 status code with an object containing a message that advices you to try in the correct path by listing all posible path in "routes".
To acces production or staging, you have to set NODE_ENV variable to one of those, the default is staging.