Actualizar control de glucemias con eje Y secundario para correcciones e integracion de tienda

This commit is contained in:
2026-08-09 14:54:22 +00:00
parent 113bfe50ac
commit 3dae81645f
31 changed files with 4080 additions and 627 deletions
+34
View File
@@ -0,0 +1,34 @@
import express from 'express';
import path from 'path';
import { createServer as createViteServer } from 'vite';
import apiApp from './server/index.js';
async function startServer() {
const app = express();
const PORT = 3000;
const HOST = '0.0.0.0';
// Mount API routes
app.use(apiApp);
// Vite middleware for development or static serving for production
if (process.env.NODE_ENV !== 'production') {
const vite = await createViteServer({
server: { middlewareMode: true },
appType: 'spa',
});
app.use(vite.middlewares);
} else {
const distPath = path.join(process.cwd(), 'dist');
app.use(express.static(distPath));
app.get('*', (_req, res) => {
res.sendFile(path.join(distPath, 'index.html'));
});
}
app.listen(PORT, HOST, () => {
console.log(`Hospital Server running on http://${HOST}:${PORT}`);
});
}
startServer();