iching-broker-level2/backend/server.ts
Christopher Hase 69bd8bef0f
All checks were successful
ci / build (push) Successful in 1m19s
add http-server part 7.8
2025-04-11 11:21:06 +02:00

18 lines
No EOL
429 B
TypeScript

import express from 'express';
import cors from 'cors'; // <--- hinzufügen
import { executeCommand } from './broker.js';
const app = express();
const port = 8090; //TODO: OR 8080
//CORS aktivieren
app.use(cors());
app.post('/api/command', (req, res) => {
executeCommand();
res.status(200).send('Command executed');
});
app.listen(port, '0.0.0.0', () => {
console.log(`Server läuft auf http://0.0.0.0:${port}`);
});