From 608b1cbe4da83182d2a7d39af7f2f7645ceaa13d Mon Sep 17 00:00:00 2001 From: Felix Kaspar Date: Tue, 7 Nov 2023 01:45:16 +0100 Subject: [PATCH] better serve --- index.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 024e98b1..914f84c9 100644 --- a/index.js +++ b/index.js @@ -1,20 +1,17 @@ -import api from './server-node/routes/api/index.js'; - import express from 'express'; const app = express(); const PORT = 8080; - -// Static Middleware -app.use(express.static('./client-vanilla')); -app.use(express.static('./shared-operations')); - -app.get('/', function (req, res, next) { // TODO: Use EJS? - res.render('home.ejs'); -}); +// server-node: backend api +import api from './server-node/routes/api/index.js'; app.use("/api/", api); +// client-vanilla: frontend +app.use(express.static('./client-vanilla')); +app.use(express.static('./shared-operations')); + +// serve app.listen(PORT, function (err) { if (err) console.log(err); console.log(`http://localhost:${PORT}`);