This commit is contained in:
parent
69bd8bef0f
commit
bb8c2f06fd
2 changed files with 6 additions and 3 deletions
|
@ -1,12 +1,15 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import cors from 'cors'; // <--- hinzufügen
|
import cors from 'cors';
|
||||||
import { executeCommand } from './broker.js';
|
import { executeCommand } from './broker.js';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 8090; //TODO: OR 8080
|
const port = 8090;
|
||||||
|
|
||||||
//CORS aktivieren
|
//CORS aktivieren
|
||||||
app.use(cors());
|
//app.use(cors());
|
||||||
|
app.use(cors({
|
||||||
|
origin: 'http://localhost:8080'
|
||||||
|
}));
|
||||||
|
|
||||||
app.post('/api/command', (req, res) => {
|
app.post('/api/command', (req, res) => {
|
||||||
executeCommand();
|
executeCommand();
|
||||||
|
|
Loading…
Reference in a new issue