Files
throttle_motor_mapping/app/routes/public_routes.js
T
2025-05-29 12:33:41 +03:00

26 lines
939 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 - might implement authentication step here...
*/
router.get("/", (req, res) => {
res.render("auth", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
protocol: app_conf.protocol,
host: app_conf.host,
port: app_conf.port
});
});
module.exports = router;