22 lines
639 B
JavaScript
22 lines
639 B
JavaScript
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!`);
|
|
});
|