Extracted stack files

This commit is contained in:
yusufipk
2025-12-17 13:31:08 +00:00
parent 35ca3d93e4
commit 51eacc7a1c
75 changed files with 14489 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import express, { type Express } from "express";
import fs from "fs";
import path from "path";
export function serveStatic(app: Express) {
const distPath = path.resolve(__dirname, "public");
if (!fs.existsSync(distPath)) {
throw new Error(
`Could not find the build directory: ${distPath}, make sure to build the client first`,
);
}
app.use(express.static(distPath));
// fall through to index.html if the file doesn't exist
app.use("*", (_req, res) => {
res.sendFile(path.resolve(distPath, "index.html"));
});
}