UNPKG

polar

Version:

boilerplate for a basic express setup with metaserve

41 lines (29 loc) 1.36 kB
polar ===== Boilerplate for a basic [Express](http://github.com/visionmedia/express) setup. * Simple request logging * Cookie and form parsing * Jade templating * Static file serving * Static file preprocessing (with [Metaserve](http://github.com/prontotype-us/metaserve)) ## Usage Create an app instance just as you would with Express, passing options to `polar`. Start the app with `app.start()`. ```coffee polar = require 'polar' app = polar port: 8583 app.get '/', (req, res) -> res.render 'hi', date: new Date() app.start() ``` ### Options * `port` **REQUIRED** — Port for your app to listen on * `middleware` — Array of middleware functions * `metaserve` — Metaserve options object, default uses [metaserve-css-styl](https://github.com/prontotype-us/metaserve-css-styl/) and [metaserve-js-coffee-reactify](https://github.com/prontotype-us/metaserve-js-coffee-reactify) * `view_dir` — Directory to look for view templates in, default is `/views` * `view_engine` — Templating engine, default is [Jade](https://github.com/jadejs/jade) * `no_cookie_parser` — Do not use `express.cookieParser` * `no_body_parser` — Do not use `express.bodyParser` * `session` — Configuration for connect-redis, default is null (no sessions) * `secret` — Secret key for connect-redis sessions