Methods
delete(path, callback)
Register a callback for a DELETE route.
Callback with receive params (requestData, respondWith)
requestData is an object with various request data like "body"
respondWith is a function that takes (statusCode = 200, responseData = '', contentType = 'text/json')
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The path |
callback |
function | The callback |
get(path, callback)
Register a callback for a GET route.
Callback with receive params (requestData, respondWith)
requestData is an object with various request data like "body"
respondWith is a function that takes (statusCode = 200, responseData = '', contentType = 'text/json')
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The path |
callback |
function | The callback |
post(path, callback)
Register a callback for a POST route.
Callback with receive params (requestData, respondWith)
requestData is an object with various request data like "body"
respondWith is a function that takes (statusCode = 200, responseData = '', contentType = 'text/json')
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The path |
callback |
function | The callback |
put(path, callback)
Register a callback for a PUT route.
Callback with receive params (requestData, respondWith)
requestData is an object with various request data like "body"
respondWith is a function that takes (statusCode = 200, responseData = '', contentType = 'text/json')
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The path |
callback |
function | The callback |
route(method, path) → {function}
Returns the callback for the route defined by the method and path.
Parameters:
Name | Type | Description |
---|---|---|
method |
string | The http method used (GET, POST, etc) |
path |
string | The path being called |
Returns:
The function registered for the desired route
- Type
- function