This is a Node.js and Bootstrap example web application. Express is used as the web application framework. Bower is used as the front-end package manager (i.e. for Bootstrap and jQuery). Grunt is used to run the Less pre-processor (which generates the CSS assets) and to minify both the the CSS and JavaScript assets. This web application is configured to be deployed with Heroku.
- Node.js
- Heroku Toolbelt (includes Heroku client, Foreman, and Git)
- Grunt CLI
- Nodemon (optional)
Install the npm dependencies:
npm install
This will also install the Bower dependencies and run Grunt.
Run Grunt:
grunt
Optionally, have Grunt watch for changes in your Less files:
grunt watch
Start the server and other processes in development mode with Foreman:
foreman start -f Procfile.dev
The Node.js server will be listening on port 5000:
http://localhost:5000
Running in development mode requires Nodemon, which monitors for changes and automatically restarts the server. Note that both the Node.js server and grunt watch
are run simultaneously in development mode (so there is no need to run Grunt separately).