handler

Handler is an Express routing helper

npm install handler
1 downloads in the last week
7 downloads in the last month

Handler

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

Installation

npm install handler

Usage

# First require handler
require 'handler'

# Create express app
app = express.createServer()

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

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

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

npm loves you