This commit is contained in:
Milana
2023-10-02 13:59:38 +03:00
parent c80a29bb75
commit 2f898e6755
19 changed files with 586 additions and 11 deletions

16
run.js
View File

@@ -1,14 +1,18 @@
const express = require('express');
const path = require('path');
const app = express();
const port = 8080;
app.use(express.static(path.join(__dirname, 'webpage/public')));
// app.use(express.static(path.join(__dirname, 'webpage/public')));
app.get('/', async(req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
// app.get('/', async(req, res) => {
//// res.sendFile(path.join(__dirname, 'webpage/public', 'index.html'));
// res.sendFile(path.join(__dirname, 'webpage/public', 'index.html'));
});
// });
app.listen(80, () => {
console.log("Server successfully running on port 8080");
app.use(express.static(path.join(__dirname, "webpage/public")));
// app.use("/posts", express.static(path.join(__dirname, "webpage/content/posts")))
app.listen(port, () => {
console.log(`Server successfully running on port ${port}`);
});