sync & async api
This commit is contained in:
4
index.js
4
index.js
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user