sync & async api

This commit is contained in:
Felix Kaspar
2023-10-19 19:46:23 +02:00
parent c60de02e14
commit 5203fc3605
8 changed files with 673 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
import api from './routes/api/index.js';
import express from 'express';
const app = express();
const PORT = 8080;
@@ -10,7 +12,7 @@ app.get('/', function (req, res, next) { // TODO: Use EJS?
res.render('home.ejs');
});
// TODO: Import and server /api
app.use("/api/", api);
app.listen(PORT, function (err) {
if (err) console.log(err);