Post UX Change
This commit is contained in:
1 parent
d077c68e96
commit
0fa80d1fb9
9 files changed
+778
-87
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import express from 'express';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/health', (req, res) => {
|
||||
res.json({ status: 'ok' });
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -0,0 +1,23 @@
|
||||
import express from 'express';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import apiRouter from './api.js';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const distDir = path.join(__dirname, '..', 'dist');
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(express.json());
|
||||
app.use('/api', apiRouter);
|
||||
|
||||
app.use(express.static(distDir));
|
||||
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(distDir, 'index.html'));
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Datacenter Modeler listening on http://localhost:${port}`);
|
||||
});
|
||||
Reference in new issue
Block a user