21 lines
586 B
JavaScript
21 lines
586 B
JavaScript
const express = require("express");
|
|
const path = require("path");
|
|
|
|
const app = express();
|
|
const PORT = 3000;
|
|
|
|
// Static folders (images, fonts, css etc.)
|
|
app.use("/images", express.static(path.join(__dirname, "images")));
|
|
app.use("/font", express.static(path.join(__dirname, "font")));
|
|
app.use("/html", express.static(path.join(__dirname, "html")));
|
|
|
|
// Startseite
|
|
app.get("/", (req, res) => {
|
|
res.sendFile(path.join(__dirname, "html", "index.html"));
|
|
});
|
|
|
|
// Server starten
|
|
app.listen(PORT, () => {
|
|
console.log(`Dynasty of Knights Server läuft auf http://localhost:${PORT}`);
|
|
});
|