add http-server part 7.9
Some checks failed
ci / build (push) Failing after 15s

This commit is contained in:
Christopher Hase 2025-04-11 11:30:53 +02:00
parent 69bd8bef0f
commit bb8c2f06fd
2 changed files with 6 additions and 3 deletions

View file

@ -1,12 +1,15 @@
import express from 'express';
import cors from 'cors'; // <--- hinzufügen
import cors from 'cors';
import { executeCommand } from './broker.js';
const app = express();
const port = 8090; //TODO: OR 8080
const port = 8090;
//CORS aktivieren
app.use(cors());
//app.use(cors());
app.use(cors({
origin: 'http://localhost:8080'
}));
app.post('/api/command', (req, res) => {
executeCommand();