tuxcord.net/chat/node.js

18 lines
451 B
JavaScript

const express = require('express');
const app = express();
const port = 7080;
const rootPath = "/var/www/tuxcord.net/"
app.post("/chat/submit-comment", (req,res) => {
console.log("nick: ", req.body.nick);
console.log("said: ", req.body.comment);
res.redirect(302, req.get("referer"));
});
app.use(express.static(rootPath));
app.listen(port, () => {
console.log(`Server is running at
http://localhost:${port}
in directory: ${rootPath}`);
});