Code examples for following post:
- Install Node.js
- Open cmd.exe and navigate to project's folder.
- Install project dependencies with following command
npm install
Run project with following command
npm start
There are several functionalities implemented in the stub. See linked posts for more details how to use them.
Database where you can add, get or remove contacts with JSON showing RESTful web services functionality described in blog post. GET endpoints are: http://localhost:3000/person/all, http://localhost:3000/person/get/{id}, http://localhost:3000/person/remove. POST endpoint is: http://localhost:3000/person/save.
http://localhost:3000/api/version returns a configuration value that is read from external config file.
Docker container is packaged with tag contact-rest with following command:
docker build . -t contact-rest
Docker container is run with exposing port 3000 from the container to port 9000 on host with following command:
docker run -e VERSION=1.1 -p 9000:3000 contact-rest