Skip to content

ministryofjustice/moj-nodejs-boilerplate

 
 

Repository files navigation

GDS Node.js boilerplate

This is a skeleton Node.js app running on Express with Nunjucks as a template engine.

It includes:

  • Grunt for compliation of sass/js
  • GOV.UK Frontend
  • Browserify with babelify and Nunjucksify
  • Mocha for testing
  • Middleware to set correlation headers
  • i18n language support
  • Snyk
  • StandardJS for linting
  • nvm (optional) for nodejs version

To get started clone the repo and run

$ npm install
$ npm start

(npm install might error about Snyk if it’s not set up but ignore for now)

Then go to http://localhost:3000/ to see it in action.

Using nvm (optional)

If you work across multiple Node.js projects there's a good chance they require different Node.js and npm versions.

To enable this we use nvm (Node Version Manager) to switch between versions easily.

  1. install nvm
  2. Run nvm install in the project directory (this will use .nvmrc)
  3. Follow the steps above to install and start

About

A Node.js project boilerplate for production apps

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.6%
  • HTML 17.0%
  • CSS 3.4%