Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.33 KB

README.md

File metadata and controls

40 lines (29 loc) · 1.33 KB

polar

Boilerplate for a basic Express setup.

  • Simple request logging
  • Cookie and form parsing
  • Jade templating
  • Static file serving
  • Static file preprocessing (with Metaserve)

Usage

Create an app instance just as you would with Express, passing options to polar. Start the app with app.start().

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 and metaserve-js-coffee-reactify
  • view_dir — Directory to look for view templates in, default is /views
  • view_engine — Templating engine, default is 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