mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 00:57:12 -05:00
24 lines
634 B
JavaScript
24 lines
634 B
JavaScript
import express from 'express';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
const app = express();
|
|
const port = process.env.PORT || 8080;
|
|
|
|
app.use(express.static(path.join(__dirname, 'public')));
|
|
|
|
app.get('/health', (_req, res) => {
|
|
res.json({ status: 'ok', service: 'blackroad-operating-system' });
|
|
});
|
|
|
|
app.get('*', (_req, res) => {
|
|
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
|
});
|
|
|
|
app.listen(port, '0.0.0.0', () => {
|
|
console.log(`BlackRoad OS placeholder server listening on port ${port}`);
|
|
});
|