This is a laboratory to study REST service creation, testing and deployment using Docker. Work in progress.
REST service will run on port 8080(when run from docker) and will control the data of the clients. Data per customer:
- Name
- Last name
- Date of birth
- Phone number
The following routes can be accessed when service is running:
-
Route:
/client
Methods: POST, GET -
Route:
/client/:id
Methods: GET, PUT, DELETE
In order to prepare the docker for running this code use the following command in the root directory, docker
must be installed in the computer:
docker-compose build
To run all the services inside docker use:
docker-compose up
In order to compile and run the program the host computer should have installed mongodb
, node
and npm
. Run the following command in the root directory to install node modules dependencies.
npm install
to run the server use:
node app.js
To run the test cases use:
npm test
Note: database connection could be needing adjusting if run from source, edit app.js file for this.
Public domain