Skip to content

Instantly share code, notes, and snippets.

@BoLaMN
Created May 13, 2015 16:22
Show Gist options
  • Save BoLaMN/113ef0f29146867bacee to your computer and use it in GitHub Desktop.
Save BoLaMN/113ef0f29146867bacee to your computer and use it in GitHub Desktop.
# action
exports.test =
name: 'test'
description: 'test'
routes:
get: [
{ path: "/routes" }
{ path: "/routes/:test" }
]
post: [
{ path: "/paths/" }
{ path: "/paths/:test" }
]
run: (api, data, next) ->
next()
#initialize
module.exports =
loadPriority: 999
startPriority: 999
stopPriority: 999
initialize: (api, next) ->
actions = api.actions.actions
for action of actions
for version of actions[action]
for method, routes of actions[action][version].routes
for route in routes
api.routes.registerRoute method, route.path, action, version
next()
start: (api, next) -> next()
stop: (api, next) -> next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment