Skip to content

Divio Cloud based boilerplate to develop with Express

License

Notifications You must be signed in to change notification settings

divio/express-boilerplate

Repository files navigation

Express Boilerplate

Divio Cloud based boilerplate to develop with Express JS.

Up to date with Express 4.18.1.

The project files have been generated using express-generator. An example database connection has been added to myapp/app.js from the Express guides.

Local Development

This boilerplate installs node_modules into the root of the Docker container. To work seamless locally, you need to run docker-compose using the correct prefix:

docker-compose run --rm web npm install jquery --save --prefix /

And to save it to your projects directory:

docker-compose run --rm web npm install jquery --save

Otherwise you might run into unexpected issues as the node_modules folder is in the root of the container and your project directory. Alternatively delete the node_modules folder from the root of the container while working locally.

We are using nodemon locally to monitor changes and restart the server automatically.

Database

The boilerplate uses pg-promise to talk to the database. A good example of the usage can be found here.