This boilerplate is a reconstruction of yanexbo. It is simple in nature and updated to compile under express 4.x
Some changes to yanexbo and extra inclusions:
- Uses Express.js 4.x instead of 3.x
- Uses Hogan.js instead of Jade
- Example Hogan.js variables & partials
- Comes with sanitize-html package for simple user input sanitization.
via git and npm:
$ git clone https://github.com/maxmastalerz/express4-boilerplate.git
$ cd express4-boilerplate.git
$ npm install
Database and other environment specific application configuration is meant to be stored in ./config.js
.
...
development: {
db: 'mongodb://localhost:27017/developmentDB'
}
...
node app.js
Open http://localhost:3000
for sample page.
/public Public (static) static files for express http server
/public/javascripts Public javascript files
/public/javascripts/app.js Sample javascript file (just a wrapper)
/public/stylesheets Public stylesheet files
/public/stylesheets/app.js Sample stylesheet file (minimalistic)
/uploads Destination for file uploads
/routes Routing modules ("controllers")
/routes/index.js Example routing module
/routes/hello.js Example routing module
/views/ View templates
/views/partials/head.html Example hogan partial
/views/index.html Example hogan view template
/views/dump.html Example hogan view template
/config.js Database and application related configuration
/express-routes.js Express routing definitions
/express-settings.js Express configuration / settings
/server.js Main file for bootstrapping and starting node http server
Ideas, suggestions and pull requests are welcome.
Copyright (c) 2015 Max Mastalerz <[email protected]>