devbug/app/routing/routers/dash/v1.routes.js

86 lines
3.7 KiB
JavaScript
Raw Normal View History

2019-06-21 22:01:34 +00:00
/*
* 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',
2019-06-23 17:17:35 +00:00
2019-06-21 22:01:34 +00:00
/*
* 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'),
2019-06-24 16:45:22 +00:00
_flitter.mw('auth:RequireAuth'),
_flitter.mw('v1:Invite')
2019-06-21 22:01:34 +00:00
],
/*
* 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: {
'/': [ _flitter.controller('dash:v1').main ],
'/project/new': [ _flitter.controller('dash:v1').new_project_show ],
'/project/view/:id': [ _flitter.controller('dash:v1').project_view ],
'/project/view/:id/inline/:type': [ _flitter.controller('dash:v1').project_view_inline_helper ],
2019-06-22 17:51:29 +00:00
'/project/delete/:id': [ _flitter.controller('dash:v1').project_delete_show ],
'/project/edit/:id': [ _flitter.controller('dash:v1').project_edit_show ],
2019-07-24 14:52:58 +00:00
'/:api/share/:id': [ _flitter.controller('dash:v1').project_share_show ],
'/:api/share/:id/share/:user': [ _flitter.controller('dash:v1').project_share_do ],
'/:api/share/:id/share/:user/edit': [ _flitter.controller('dash:v1').project_share_edit_do ],
'/:api/share/:id/revoke/:user': [ _flitter.controller('dash:v1').project_share_revoke ],
'/:api/share/:id/revoke/:user/edit': [ _flitter.controller('dash:v1').project_share_revoke_edit ],
'/:api/share/:id/transfer/:user': [ _flitter.controller('dash:v1').project_share_transfer ],
'/:api/share/:id/invite': [ _flitter.controller('dash:v1').project_share_invite ],
2019-07-23 21:44:40 +00:00
'/project/snippet/:id/new': [ _flitter.controller('dash:v1').project_snippet_new ],
'/project/snippet/:id/view/:snippet': [ _flitter.controller('dash:v1').project_snippet_view ],
2019-07-24 17:05:27 +00:00
'/project/snippet/:id/delete/:snippet': [ _flitter.controller('dash:v1').project_snippet_delete ],
'/project/snippet/:id/edit/:snippet': [ _flitter.controller('dash:v1').project_snippet_edit ],
2019-06-22 17:51:29 +00:00
2019-07-24 20:30:51 +00:00
'/using_devbug/:page': [ _flitter.controller('dash:v1').show_usage_page ],
2019-06-21 22:01:34 +00:00
'/out/view/:id': [ _flitter.controller('dash:v1').out_view ],
2019-06-23 17:17:35 +00:00
'/out/delete/:id/:project': [ _flitter.controller('dash:v1').out_delete ],
'/code': [ _flitter.controller('dash:v1').view_code ],
2019-06-24 16:45:22 +00:00
'/invitation/accept': [ _flitter.controller('dash:v1').accept_invite ],
2019-06-21 22:01:34 +00:00
},
/*
* 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 ],
2019-06-22 17:51:29 +00:00
'/project/delete/:id': [ _flitter.controller('dash:v1').project_delete_do ],
'/project/edit/:id': [ _flitter.controller('dash:v1').project_edit_do ],
2019-07-23 21:44:40 +00:00
'/project/snippet/:id/new': [ _flitter.controller('dash:v1').project_snippet_new_do ],
2019-07-24 17:05:27 +00:00
'/project/snippet/:id/edit/:snippet': [ _flitter.controller('dash:v1').project_snippet_edit_do ],
2019-06-21 22:01:34 +00:00
},
}
2019-06-23 17:17:35 +00:00
module.exports = v1