feat(backend): Express-Server liefert statisch + /api/health
This commit is contained in:
parent
4eed9d0c4c
commit
3b0632c4b9
4 changed files with 58 additions and 9 deletions
17
server/index.js
Normal file
17
server/index.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
const path = require('path');
|
||||
const express = require('express');
|
||||
|
||||
const app = express();
|
||||
app.use(express.json({ limit: '5mb' }));
|
||||
|
||||
app.get('/api/health', (req, res) => res.json({ status: 'ok' }));
|
||||
|
||||
// Statisches Frontend (Repo-Root). Dotfiles werden per Default nicht ausgeliefert.
|
||||
app.use(express.static(path.join(__dirname, '..')));
|
||||
|
||||
if (require.main === module) {
|
||||
const PORT = process.env.PORT || 3000;
|
||||
app.listen(PORT, '0.0.0.0', () => console.log(`Dienstplan-Pro auf :${PORT}`));
|
||||
}
|
||||
|
||||
module.exports = app;
|
||||
Loading…
Add table
Add a link
Reference in a new issue