2020-02-08 08:39:33 +00:00
|
|
|
/*
|
|
|
|
* 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: [
|
2020-02-08 12:57:38 +00:00
|
|
|
'auth:UserOnly',
|
2020-02-08 08:39:33 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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: {
|
2020-02-08 11:06:18 +00:00
|
|
|
'/hello_world': ['controller::api:v1:Misc.hello_world'],
|
2020-02-08 12:57:38 +00:00
|
|
|
'/page/:PageId': ['controller::api:v1:Page.get_page'],
|
2020-02-08 17:16:04 +00:00
|
|
|
'/page/:PageId/nodes': ['controller::api:v1:Page.get_nodes'],
|
2020-02-08 18:36:42 +00:00
|
|
|
|
|
|
|
'/menu/items': ['controller::api:v1:Menu.get_items'],
|
2020-02-08 08:39:33 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
2020-02-08 12:57:38 +00:00
|
|
|
'/page/:PageId/save': ['controller::api:v1:Page.save_page'],
|
2020-02-08 17:16:04 +00:00
|
|
|
'/page/:PageId/nodes/save': ['controller::api:v1:Page.save_nodes'],
|
2020-02-08 08:39:33 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = index
|