24 lines
484 B
JavaScript
24 lines
484 B
JavaScript
var express = require('express');
|
|
var route = express.Router();
|
|
|
|
|
|
route.all('/', function(req, res, next) {
|
|
// TODO: show login page or dashboard
|
|
// res.end('login or dashboard');
|
|
res.render('auth/views/index');
|
|
});
|
|
|
|
route.all('/*', (req, res, next) => {
|
|
// passthrough to next route
|
|
if(req.path.startsWith('/api'))
|
|
return next();
|
|
|
|
// TODO: try to login
|
|
// TODO: role-based authorization
|
|
// TODO: show login page or page
|
|
|
|
res.end('500 - LEL');
|
|
});
|
|
|
|
module.exports = route;
|