This template uses Grunt, the Javascript Task Runner. To use Grunt with this Template App, do the following:
- Install grunt:
npm install -g grunt-cli
- In your App directory, run:
npm install
. This installs Grunt plugins, etc for use with this App.
The following are a short overview of the Grunt tasks available for this App. You can get a full list of tasks from Grunt with grunt --help
.
Run grunt serve
to serve this App locally. By default this App will run on http://localhost:8001.
Note that 'grunt serve' supports live reload, i.e. it will monitor for any changes in your node.js application and automatically restart the server
Run grunt debug
to debug this App locally. This task uses Node Inspector to debug your application, and will open the Debugger at 'application.js' in Google Chrome. See the documentation for Node Inspector for more information on how to use Node Inspector.
Run grunt test
to run the unit tests for this App.
This App uses Istanbul for generating code coverage for your tests.
Run grunt coverage
to run code coverage for this App.
Run grunt analysis
to get a static analysis report of your code. This task uses Plato to generate the report. See the documentaion for Plato for more information on how to use and configure Plato.
The grunt env plugin is included by default. To set your own environment variables, modify the env
config accordingly, e.g.
env : {
options : {},
// Sample environment variable - see https://github.com/jsoverson/grunt-env for more information
local : {
SAMPLE_ENV_VAR : 'sample-env-var'
}
},
Alternatively you can load environment variables from a local file, see the grunt env
documentation for more details.