You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
maettleship/index.js

21 lines
441 B

const express = require("express");
const app = express();
const http = require("http").createServer(app);
const path = require("path");
const port = 8081;
const io = require("socket.io")(http);
app.use(express.static("public"));
http.listen(port, () => {
console.log(`Listening on http://localhost:${port}`);
});
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "/public/index.html"));
});
module.exports = {
io,
};