The project consists of CRUD operation, testing the endpoints, authenticating using jwt, dockerizing the app, adding swagger
npm : download npm
nodejs: download nodejs
installing express package
installing mongoose package
download mocha
download chai
installing jwt package
setup docker
installing swagger
/model/usermodel.js : contains the schema and the basic validate function
/config/custom-environment-variable: contains the variable jwtPrivatekey, needed for authontication
/routes/users.js : contain the implementation of the CRUD operation, and the yaml for the swagger documentation
/routes/auth.js: contain the implementation of the authentication function with the private key environment variable
/test/usermodeltest.js: contain the unit tests of the basic operation
index.js : contain the basic connections ( connection to localhost ,connection to mongoose, connection with the swagger-docs and api)
to run the program :
-set the jwtprivateKey : set task_jwtPrivateKey={variable}
-operate with node : node index.js
to test the program :
npm test