Introduction
A razor-sharp DSL for express inspired by Zappa.
Install
npm install ex
Usage
Ex binds this
to useful things and provides a few utility methods which are
helpful. The simple ex app is probably:
require @get '/'-> @send 'hello world' @run
The default express app could be rewritten like so:
ex = require 'ex' ex -> # all environments @set 'port'processenvPORT or 3000 @set 'views'__dirname + '/views' @set 'view engine''jade' @use exfavicon @use exlogger 'dev' @use exbodyParser @use exmethodOverride @use @approuter @use exstatic __dirname + '/public' # development only @development -> @use exerrorHandler @get '/'-> @render 'index'title: 'Ex' @run => consolelog 'Ex listening on port ' + @get 'port'