A Basic Node.js/Express REST API implementation example for logging.
- Node.js
- NPM
- Run
npm install
to installl dependencies - Run
npm start
to start the local server - Load
http://localhost:3000
to test the endpoint. It will display a json result{"message":"Ok"}
user signup
curl --header "Content-Type: application/json" \
--request POST \
--data '{"email":"yasas@gmail.com","password":"xyz"}' \
http://localhost:3000/auth/signup
Get a list of users -Not Authenticated
curl http://localhost:3000/api/users
Get a list of users - Authenticated
curl --header "Authorization: Bearer token" \
--request GET \
http://localhost:3000/api/users | json_pp