Refactor build and start scripts in package.json; add plugin to exclude debug files from production build in vite.config.ts; remove ConnectScreen component and replace with ConnectionPlaceholder in multiple pages; update DeviceContext to auto-connect using device IP from URL; enhance locale files with new device IP labels.
This commit is contained in:
+3
-7
@@ -10,17 +10,13 @@ async function startServer() {
|
||||
const app = express();
|
||||
const server = createServer(app);
|
||||
|
||||
// Serve static files from dist/public in production
|
||||
const staticPath =
|
||||
process.env.NODE_ENV === "production"
|
||||
? path.resolve(__dirname, "public")
|
||||
: path.resolve(__dirname, "..", "dist", "public");
|
||||
const staticPath = path.resolve(__dirname, "..", "dist");
|
||||
|
||||
app.use(express.static(staticPath));
|
||||
|
||||
// Handle client-side routing - serve index.html for all routes
|
||||
// Handle client-side routing — entry is i.html (see vite rollup input)
|
||||
app.get("*", (_req, res) => {
|
||||
res.sendFile(path.join(staticPath, "index.html"));
|
||||
res.sendFile(path.join(staticPath, "i.html"));
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
Reference in New Issue
Block a user