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

20 lines
405 B

const express = require("express");
const app = express();
const http = require("http").Server(app);
const io = require("socket.io")(http);
const port = 8081;
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,
};