- lightweight
- uses PostgreSQL database
- async methods
- documentation with ApiDoc
- testing (coming soon)
server.js
: entry pointapp.js
: the express objectroutes
: list of routes/endpoints/controllers
: logic to handle request and response/models
: logic to get data from database/middleware
: logic related to RESTful API, e.g authorization, throttling, validation, etc/helpers
: simple reusable functions to be used across modules in this repository
- Get the repository, choose one of the following:
- clone via HTTPS :
git clone https://github.com/yogski/express-microservice-boilerplate.git
- clone via SSH :
git clone git@github.com:yogski/express-microservice-boilerplate.git
- Click "Use This Template", create your repository, then clone it.
- clone via HTTPS :
- Change to
express-microservice-boilerplate
directory or your own repository, then runnpm install
. - Run
npm install
- Add endpoint on
routes.js
- Add controller in
/controllers
folder - Add model in
/models
folder, then handle the query - Connect the model to controller in step 2
- Connect the controller to endpoint in step 1
(coming soon)
- Go to
controllers
, then add documentation for specific endpoint
- Install apidoc globally :
npm install -g apidoc
. - Run
npm run docs:generate
- Documentation can be accessed on
{HOSTNAME}/docs
Please raise an issue if there is bug or feature request.