You need a .env
file. Use .env.dist
as a template.
You need a MongoDB instance running.
sudo systemctl start mongod
Check status.
sudo systemctl status mongod
You must install npm packages from package.json.
npm i
Use start
script from package.json.
npm start
These commands can be executed in the terminal, or you can use an alternative like Postman.
curl -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d '{
"name": "Jhon",
"lastName": "Doe",
"color": "red",
"email": "[email protected]",
"dni": "143996799",
"age": 27,
"enabled": true
}'
curl -X GET http://localhost:3000/api/users
curl -X POST http://localhost:3000/api/users/<user_id>/disable \
-H "Content-Type: application/json"
url -X GET http://localhost:3000/api/users/<user_id>
curl -X PUT http://localhost:3000/api/users/<user_id> \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'