You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB
JavaScript

const express = require("express");
const path = require("path");
const routes = require("./views/routes");
const port = 3000;
// Init App
const app = express();
app.set("view engine", "pug");
// Static Files
app.use(express.static("public"));
app.use("/css", express.static(__dirname + "public/css "));
app.use("/js", express.static(__dirname + "public/js "));
app.use("/img", express.static(__dirname + "public/img "));
// Home Route
// for (route of routes) {
// // console.log(route);
// app.get(route.link, function (req, res) {
// console.log(req.url);
// console.log(route);
// res.render(route.renderFile, routes);
// });
// }
app.get("/", function (req, res) {
res.render("index", routes);
});
app.get("/flasher", function (req, res) {
res.render("flasher", routes);
});
app.get("/p_generator", function (req, res) {
res.render("p_generator", routes);
});
app.get("/pcb_panel_bom", function (req, res) {
res.render("pcb_panel_bom", routes);
});
app.get("/invoice_sign", function (req, res) {
res.render("invoice_sign", routes);
});
// Start Server
app.listen(port, function () {
console.log(`Server started on port ${port}...`);
});