Template for a Node.js based REST API with a database and an ORM support.
The following components are used in this template
- Express: Fast, unopinionated, minimalist web framework for Node.js
- Sequelize: ORM for several databases, which abstracts the data access
- Swagger UI Express: Serves auto-generated swagger-ui generated API docs from Express
- swagger-jsdoc: Enables the integration of Swagger using JSDoc comments in code
- REST_PORT
- REST_INIT_DB
- REST_DB_NAME
- REST_DB_USER
- REST_DB_PASS
- REST_DB_HOST
- REST_DB_PORT
- REST_DB_LOGGING
- REST_LOGLEVEL
git clone <this-repo>
cd node-rest-db-template
npm install
npm run start-dev
cd /path/to/this/checkout
npm run test
cd /path/to/this/checkout
npm start
cd /path/to/this/checkout
REST_INIT_DB=true npm start
cd /path/to/this/checkout
REST_PORT=8888 npm start
cd /path/to/this/checkout
# docker build -t <image-name> .
docker build -t my_rest_server .
# docker run -e REST_API_PORT=9999 -p 9999:9999 <image-name>
docker run -e REST_API_PORT=9999 -p 9999:9999 my_rest_server