This commit is contained in:
2025-03-31 00:22:21 +03:00
commit 38f2a05107
146 changed files with 66771 additions and 0 deletions

21
web/server.js Normal file
View File

@@ -0,0 +1,21 @@
const express = require("express");
const path = require("path");
const app = express();
const PORT = 4002;
const DIR = process.env.CARDS_PATH || path.join(__dirname, '../cards');
// Раздача статических файлов из папки, указанной в DIR
app.use('/cards', express.static(DIR));
// Раздача других статических файлов из текущей папки
app.use(express.static(__dirname));
// Обработка 404 ошибки
app.use((req, res) => {
res.status(404).sendFile(path.join(__dirname, "index.html"));
});
app.listen(PORT, () => {
console.log(`Serving app on port ${PORT} ...`);
});