Created
May 13, 2015 16:22
-
-
Save BoLaMN/113ef0f29146867bacee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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