49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
/*
|
|
* API v1 Routes
|
|
* -------------------------------------------------------------
|
|
* Description here
|
|
*/
|
|
const index = {
|
|
|
|
/*
|
|
* Define the prefix applied to each of these routes.
|
|
* For example, if prefix is '/auth':
|
|
* '/' becomes '/auth'
|
|
* '/login' becomes '/auth/login'
|
|
*/
|
|
prefix: '/api/v1',
|
|
|
|
/*
|
|
* Define middleware that should be applied to all
|
|
* routes defined in this file. Middleware should be
|
|
* included using its non-prefixed canonical name.
|
|
*
|
|
* You can pass arguments along to a middleware by
|
|
* specifying it as an array where the first element
|
|
* is the canonical name of the middleware and the
|
|
* second element is the argument passed to the
|
|
* handler's exec() method.
|
|
*/
|
|
middleware: [
|
|
|
|
],
|
|
|
|
/*
|
|
* Define GET routes.
|
|
* These routes are registered as GET methods.
|
|
* Handlers for these routes should be specified as
|
|
* an array of canonical references to controller methods
|
|
* or middleware that are applied in order.
|
|
*/
|
|
get: {
|
|
'/hello_world': ['controller::api:v1:Misc.hello_world'],
|
|
},
|
|
|
|
post: {
|
|
'/page/save': ['middleware::auth:UserOnly', 'controller::api:v1:Misc.save_page']
|
|
|
|
},
|
|
}
|
|
|
|
module.exports = exports = index
|