devbug/app/routing/routers/index.routes.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-06-21 22:01:34 +00:00
/*
* Index Routes
* -------------------------------------------------------------
* This is a sample routes file. Routes and their handlers should be
* defined here, but no logic should occur.
*/
const index = {
/*
* Define the prefix applied to each of these routes.
* For example, if prefix is '/auth':
* '/' becomes '/auth'
* '/login' becomes '/auth/login'
*/
prefix: '/',
/*
* 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: [
// _flitter.mw('HomeLogger'),
],
/*
* 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: {
2019-06-24 19:15:09 +00:00
'/': [ _flitter.mw('v1:Invite'), _flitter.controller('Home').welcome ],
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: {
},
}
module.exports = index