Big Bang
This commit is contained in:
53
app/routing/routers/api/v1.routes.js
Normal file
53
app/routing/routers/api/v1.routes.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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: '/api/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'),
|
||||
],
|
||||
|
||||
/*
|
||||
* 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 ],
|
||||
},
|
||||
|
||||
/*
|
||||
* 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: {
|
||||
'/out/:key': [ _flitter.controller('api:v1').new_out ],
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = v1
|
||||
52
app/routing/routers/auth.routes.js
Normal file
52
app/routing/routers/auth.routes.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @module flitter-auth/deploy/routing/routers/auth
|
||||
*/
|
||||
|
||||
/**
|
||||
* These are the route definitions for Flitter-auth.
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = exports = {
|
||||
|
||||
/*
|
||||
* Define the prefix applied to each of these routes.
|
||||
* For example, if prefix is '/auth':
|
||||
* '/' becomes '/auth'
|
||||
* '/login' becomes '/auth/login'
|
||||
*/
|
||||
prefix: '/auth',
|
||||
|
||||
/*
|
||||
* 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: {
|
||||
'/register': [ _flitter.mw('auth:RequireGuest'), _flitter.controller('Auth').register_get ],
|
||||
'/login': [ _flitter.mw('auth:RequireGuest'), _flitter.controller('Auth').login_get ],
|
||||
'/logout': [ _flitter.mw('auth:RequireAuth'), _flitter.controller('Auth').logout ],
|
||||
|
||||
/*
|
||||
* A placeholder dashboard.
|
||||
*/
|
||||
'/dash': [ _flitter.mw('auth:RequireAuth'), _flitter.controller('Auth').dash_get ]
|
||||
},
|
||||
|
||||
/*
|
||||
* 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: {
|
||||
'/register': [ _flitter.mw('auth:RequireGuest'), _flitter.controller('Auth').register_post ],
|
||||
'/login': [ _flitter.mw('auth:RequireGuest'), _flitter.controller('Auth').login_post ],
|
||||
},
|
||||
}
|
||||
59
app/routing/routers/dash/v1.routes.js
Normal file
59
app/routing/routers/dash/v1.routes.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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 ],
|
||||
'/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 ],
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = v1
|
||||
54
app/routing/routers/index.routes.js
Normal file
54
app/routing/routers/index.routes.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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: {
|
||||
'/': [ _flitter.controller('Home').welcome ],
|
||||
},
|
||||
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user