19 lines
789 B
JavaScript
19 lines
789 B
JavaScript
const path = require("path");
|
|
const app_conf = require("../config/app.conf.js");
|
|
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
router.use(app_conf.paths.css.web, express.static(path.join(path.dirname(require.main.filename), app_conf.paths.css.src)));
|
|
router.use(app_conf.paths.js.web, express.static(path.join(path.dirname(require.main.filename), app_conf.paths.js.src)));
|
|
router.use(app_conf.paths.chartjs.web, express.static(path.join(path.dirname(require.main.filename), app_conf.paths.chartjs.src)));
|
|
|
|
/*
|
|
* Main endpoint - authentication happens here
|
|
* Rewritting the whole url to fix logout bug
|
|
*/
|
|
router.get("/", (req, res) => {
|
|
res.redirect(`${app_conf.protocol}://${app_conf.host}:${app_conf.port}${app_conf.app_url}`);
|
|
});
|
|
|
|
module.exports = router; |