64 lines
2.1 KiB
JavaScript
64 lines
2.1 KiB
JavaScript
/*
|
|
* v1 Routes
|
|
* -------------------------------------------------------------
|
|
* Put some description here!
|
|
*/
|
|
const v1 = {
|
|
|
|
/*
|
|
* Define the prefix applied to each of these routes.
|
|
* For example, if prefix is '/auth':
|
|
* '/' becomes '/auth'
|
|
* '/login' becomes '/auth/login'
|
|
*/
|
|
prefix: '/dash/v1',
|
|
|
|
/*
|
|
* Define middleware that should be applied to all
|
|
* routes defined in this file. Middleware should be
|
|
* included using Flitter's global mw() function, but
|
|
* it can also be added directly using require().
|
|
*/
|
|
middleware: [
|
|
// mw('Middleware Name'),
|
|
_flitter.mw('auth:RequireAuth')
|
|
],
|
|
|
|
/*
|
|
* Define GET routes.
|
|
* These routes are registered as GET methods.
|
|
* Handlers for these routes should be specified as
|
|
* an array of functions that are applied in order.
|
|
*
|
|
* mw() calls apply Flitter middleware
|
|
* controller() calls get methods in Flitter controllers
|
|
*/
|
|
get: {
|
|
// '/': [ controller('Controller_Name').handler_name ],
|
|
'/': [ _flitter.controller('dash:v1').main ],
|
|
|
|
'/project/new': [ _flitter.controller('dash:v1').new_project_show ],
|
|
'/project/view/:id': [ _flitter.controller('dash:v1').project_view ],
|
|
'/project/delete/:id': [ _flitter.controller('dash:v1').project_delete_show ],
|
|
'/project/edit/:id': [ _flitter.controller('dash:v1').project_edit_show ],
|
|
|
|
'/out/view/:id': [ _flitter.controller('dash:v1').out_view ],
|
|
},
|
|
|
|
/*
|
|
* Define POST routes.
|
|
* These routes are registered as POST methods.
|
|
* Handlers for these routes should be specified as
|
|
* an array of functions that are applied in order.
|
|
*
|
|
* mw() calls apply Flitter middleware
|
|
* controller() calls get methods in Flitter controllers
|
|
*/
|
|
post: {
|
|
'/project/new': [ _flitter.controller('dash:v1').new_project_do ],
|
|
'/project/delete/:id': [ _flitter.controller('dash:v1').project_delete_do ],
|
|
'/project/edit/:id': [ _flitter.controller('dash:v1').project_edit_do ],
|
|
},
|
|
}
|
|
|
|
module.exports = v1 |