To start the app, first cd
to the folder where this readme is located. Then:
npm install -g gulp
npm install
gulp
node dist/server.js
This should result in something like:
Users API listening on port 3000
!KEEP THIS TAB OPEN! it will wait for your requests
In your browser, go to http://localhost:3000
This should show a friendly message :).
Other methods, like POST and PATCH and DELETE can only be made from either Postman or from your Angular application.
Response body:
Response - 200 - Body:
{"message": "Users API up and running!"}
Response - 200 - Body:
[
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png",
"_id": "8m0nGYgSttzCNG0t"
}
]
Request body:
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png"
}
Response body:
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png",
"_id": "B1w2s30z2L3n0Jrj"
}
Request body:
{
"firstName": "NewFirstName"
}
Response (if user exists in database) - 204 - Body:
(empty)
Response (if user does not exist in database) - 404 - Body:
{"Reason": "That user does not exist"}
Request body:
{
"firstName": "NewFirstName"
}
Response (if user exists in database) - 204 - Body:
(empty)
Response (if user does not exist in database) - 404 - Body:
{"Reason": "That user does not exist"}