|
|
@ -1,8 +1,6 @@ |
|
|
|
import cors from 'cors'; |
|
|
|
import cors from 'cors'; |
|
|
|
import express, { json } from 'express'; |
|
|
|
import express, { json } from 'express'; |
|
|
|
|
|
|
|
|
|
|
|
import { GUARD_API } from './lib/consts'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { guardApi, passport, session } from './middlewares'; |
|
|
|
import { guardApi, passport, session } from './middlewares'; |
|
|
|
import routes from './routes'; |
|
|
|
import routes from './routes'; |
|
|
|
import { rrouters } from './lib/rrouters'; |
|
|
|
import { rrouters } from './lib/rrouters'; |
|
|
@ -27,7 +25,7 @@ export default (async () => { |
|
|
|
app.use(passport.authenticate('session')); |
|
|
|
app.use(passport.authenticate('session')); |
|
|
|
|
|
|
|
|
|
|
|
rrouters(app, routes.private, { |
|
|
|
rrouters(app, routes.private, { |
|
|
|
assign: GUARD_API ? (router) => [guardApi, router] : undefined, |
|
|
|
assign: (router) => [guardApi, router], |
|
|
|
route: '/api', |
|
|
|
route: '/api', |
|
|
|
}); |
|
|
|
}); |
|
|
|
rrouters(app, routes.public, { route: '/api' }); |
|
|
|
rrouters(app, routes.public, { route: '/api' }); |
|
|
|