This is a simple REST API with Node.js and Express.js with Typescript to demonstrate Best Practices, API validation, Logging, Error Handling, Testing, Use of DB initialization script, Use of Husky pre-commit hook, Containerization
We can easily run the whole project with only a single command:
docker-compose up
Docker will pull the MySQL and Node.js images (if our machine does not have them before).
Goto the URL: http://localhost/
The services can be run in the background with the command:
docker-compose up -d
Stopping all the running containers is also simple with a single command:
docker-compose down
This command initializes the database(creates the database if not exist, creates tables then populates data)
yarn run initialize:db
yarn start
yarn test