mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 14:27:20 +00:00
- ModuleManager: Central tracking for installed marketplace modules - DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module) - BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings - RootShell: Real root command execution utility - TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands - Terminal Pro module: Adds aliases (ll, la, h), command history - ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games - fade_in/fade_out animations for smooth transitions
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import path from "path";
|
|
import { createServer } from "./index";
|
|
import * as express from "express";
|
|
|
|
const app = createServer();
|
|
const port = process.env.PORT || 5000;
|
|
const host = "0.0.0.0";
|
|
|
|
// In production, serve the built SPA files
|
|
const __dirname = import.meta.dirname;
|
|
const distPath = path.join(__dirname, "../spa");
|
|
|
|
// Serve static files
|
|
app.use(express.static(distPath));
|
|
|
|
// Handle React Router - serve index.html for all non-API routes
|
|
app.get("*", (req, res) => {
|
|
// Don't serve index.html for API routes
|
|
if (req.path.startsWith("/api/") || req.path.startsWith("/health")) {
|
|
return res.status(404).json({ error: "API endpoint not found" });
|
|
}
|
|
|
|
res.sendFile(path.join(distPath, "index.html"));
|
|
});
|
|
|
|
app.listen(Number(port), host, () => {
|
|
console.log(`🚀 AeThex server running on ${host}:${port}`);
|
|
console.log(`📱 Frontend: http://${host}:${port}`);
|
|
console.log(`🔧 API: http://${host}:${port}/api`);
|
|
});
|
|
|
|
// Graceful shutdown
|
|
process.on("SIGTERM", () => {
|
|
console.log("🛑 Received SIGTERM, shutting down gracefully");
|
|
process.exit(0);
|
|
});
|
|
|
|
process.on("SIGINT", () => {
|
|
console.log("🛑 Received SIGINT, shutting down gracefully");
|
|
process.exit(0);
|
|
});
|