iching-broker-level2/backend/server.ts
Christopher Hase 174ab60173
All checks were successful
ci / build (push) Successful in 1m17s
add http-server part 8.3.1
2025-04-14 11:37:50 +02:00

17 lines
377 B
TypeScript

import express from 'express';
import cors from 'cors';
import { executeCommand } from './broker.js';
const app = express();
const port = 8090;
app.use(cors());
app.post('/api/command', (req, res) => {
executeCommand();
res.status(200).send('Command executed\n');
});
app.listen(port, '0.0.0.0', () => {
console.log(`Server läuft auf http://0.0.0.0:${port}`);
});