A project to create a Docker enabled Nodejs/Typescript MongoDB REST API which can act as a boilerplate/template.
The project follows REST Principles and Folder structure alongwith some basic Tests.
To run the cloned codebase directly, you need to have Node.js and Docker installed.
- Run
npm i
to install dependencies. - Run
sudo docker-compose up -d
to get a MongoDB instance running. - Make your own
.env
file in the project root, following the key name but not value used in.env.example
. - From there, any the following should work:
npm run test
npm run test-debug
npm start
npm run debug
"scripts": {
"start": "tsc && node --unhandled-rejections=strict ./dist/app.js",
"debug": "export DEBUG=* && npm start",
"test": "mocha -r ts-node/register 'test/**/*.test.ts' --unhandled-rejections=strict",
"test-debug": "export DEBUG=* && npm test"
},
- Create Dockerfile to Contain the REST API in a Docker container.
- Create separate databases for test and debug cases.
- Allow
patch
requests in test but not in development. - Write documentation for the APIs.