Added code.
This commit is contained in:
21
client/server.js
Normal file
21
client/server.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const express = require("express");
|
||||
const path = require("path");
|
||||
const livereload = require("livereload");
|
||||
const connectLivereload = require("connect-livereload");
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
|
||||
const liveReloadServer = livereload.createServer();
|
||||
liveReloadServer.watch(path.join(__dirname, "public"));
|
||||
app.use(connectLivereload());
|
||||
|
||||
app.use(express.static("public"));
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
res.sendFile(path.join(__dirname, "public", "index.html"));
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`UI Server running at http://localhost:${PORT}`);
|
||||
console.log(`Make sure your C server is running on port 8080!`);
|
||||
});
|
||||
Reference in New Issue
Block a user