Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (14 sloc) 356 Bytes
exports.route = (routes, app, middleware) ->
funcs =
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.