Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (14 sloc) 0.356 kb
exports.route = (routes, app, middleware) ->
funcs =
post: app.post
get: app.get
all: app.all
for type, func of funcs
for path of routes[type]
args = routes[type][path]
if not Array.isArray args
args = [args]
if middleware
args.unshift middleware
args.unshift path
func.apply app,args
Jump to Line
Something went wrong with that request. Please try again.