- Install Node, NPM and build tools:
apt-get install nodejs nodejs-legacy build-essential
- Bump Node to version
5.3.x
:sudo npm install -g n && sudo n 5.3
- Configure now, refer to the section about Configuration below.
- Use
npm run setup
to perform the initial build. - Use
npm start
or a tool like PM2 to run the process. - Alternatively,
npm run dev
starts the process in development mode.
Simply cp config/default.json config/{dest}
where dest
can be any of the following:
local.json
[deployment].json
[deployment]-[instance].json
[hostname].json
[hostname]-[instance].json
[hostname]-[deployment].json
[hostname]-[deployment]-[instance].json
Configuration files are loaded in the order shown above, where every next file
overrides the previous. Any options that are left out will be loaded from
default.json
. local.json
is always loaded, others follow the rules below:
Deployment
Is matched against the NODE_ENV
environment variable.
Instance
Is matched against the NODE_APP_INSTANCE
environment variable for
different configuration files per cluster instance. Tools like PM2 set the
NODE_APP_INSTANCE
automatically.
Hostname
Is matched against the machine host name.
For more information on configuration see the wiki.
The Skeleton to this application has a wiki which is gradually growing and might some day be a userful resource to look at for documentation.
npm run test
: Cleans, lints, unit tests and integration tests.npm run test:unit
: Unit tests.npm run test:integration
: Integration tests.npm run lint
: Static code analysis.npm run start
: Start the program.npm run dev
: Starts the program in development mode.npm run clean
: Removes build files and logs.npm run setup
: Install dependencies, test and build.npm run version
: Runs the version check. Useful for other tasks.
- The http service is provided by Express.
- Data manipulation utilities are provided by Ramda.
- Common Fantasy-Land abstractions provided by Ramda Fantasy.
- Domain-Driven-Design utilities provided by TComb and TComb Validations.
- Unit tests with mocha, chai and sinon.
- Code coverage reports for unit tests using istanbul and isparta.
- ES2015 syntax using Babel compiler.
- Code linting with eslint.