iching-broker-level2/backend/server.ts
Christopher Hase 1ddfc8c769
All checks were successful
ci / build (push) Successful in 1m9s
add http-server part 9.1
2025-04-15 16:28:48 +02:00

20 lines
529 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('/iching/api/command', (req, res) => {
//TODO no logging from inside this method???
console.log(`Backend-Server: receiving POST to /iching/api/command`);
executeCommand();
res.status(200).send('Backend-Server: Broker was called\n');
});
app.listen(port, '0.0.0.0', () => {
console.log(`Backend-Server running on http://0.0.0.0:${port}`);
});