Running the app
So far, we have done lots of coding. It's time to test it. Before running the code, start all the databases: RethinkDB, MySQL, and MongoDB.
To run the code, go to the project directory and execute the following command from the terminal:
node app.js
It will start the Node.js server and you should be able to see a similar screen to the following:
If you are running the code base in a local machine then you need to call these APIs using CURL or any API simulator:
GET /users - to retrieve all users data POST /users - to create new user PUT /users - to edit the user detail. DELETE /users - to delete the user.
Let's begin by creating a new user. We have already used the API simulator in previous chapters so let's use CURL to make the API request.
Execute the following command from the terminal to make the request:
curl -H "Content-Type: application/json" -X POST -d '{ "name": "Shahid", "dob": "03/18/1992", "gender": "male", "location": "mumbai" }' http://localhost:4000
This...