- When running an api, or simlilar project that only has feed outputs
- When a html front end is not required
- Projects that have a user interface
- SPA applications
- Projects that do not require a web-server
- Projects that will do large amounts of data manipulation
- Install Node/NPM at version 6.9.4
- Install yarn globally (npm install -g yarn)
- Inside project folder run
yarn
Port defaults to 3000, but can be overidden by setting PORT environment variable
Developmet environment can be run using
yarn start
this will start a local server and run nodemon to watch for any changes, and automatically restart the server
Test scripts can be executed by running
yarn test
For non development environments bable should be pre-run to aid performace
yarn build
This will build a pre-comiled version of the app inside the dist folder
yarn serve
This will serve the static assets from the dist folder
The project is build using babel and using an expressjs server.
Code should be written in es6, which is then compiled down as part of the build process.
All routing is configured inside app/index.js, using standard express routing
full documentation is avaliable at https://expressjs.com/en/api.html#express.router
Any static assets that are to be served "as is", should be placed inside the app/static folder. Sub folders are served using the same folder structure as they are in the file system
Tests are currently built using node assert as the main test tool, please see documentation at https://nodejs.org/api/assert.html