node package manager


Handler is an Express routing helper


Handler is a tiny node module that all it does is monkey-patches Express, allowing you to write unRESTful route objects Handler is written in coffeescript by Marcel Miranda.

Source Code

npm install handler
# First require handler
require 'handler'

# Create express app
app = express.createServer()

# Then user handler
app.handler 'admin',
  dashboard: (req, res) -> ...
    get: (req, res) -> ...
    post: (req, res) -> ...

  # Which would be equivalent to
  app.get 'admin/dashboard', (req, res) -> ...
  app.get 'admin/user', (req, res) -> ... 'admin/user', (req, res) -> ...

Copyright © 2012 Marcel Miranda. See LICENSE for further details.