cleaned up node server

This commit is contained in:
Saud Fatayerji
2023-10-26 21:53:02 +03:00
parent 02f98fb378
commit 13c4f664c2
24 changed files with 181 additions and 1261 deletions

View File

@@ -1,19 +1,21 @@
import api from './routes/api/index.js';
import operations from './routes/api/operations.js';
import express from 'express';
const app = express();
const PORT = 8080;
// Static Middleware
app.use(express.static('./public'));
app.get('/', function (req, res, next) { // TODO: Use EJS?
res.render('home.ejs');
});
app.use("/api/", api);
app.use("/api/operations", operations);
app.use("/api/workflow", workflow);
app.listen(PORT, function (err) {
if (err) console.log(err);
console.log(`http://localhost:${PORT}`);