add http-server part 7.9.5 CORS
This commit is contained in:
parent
131258aa86
commit
edf15bbf47
1 changed files with 3 additions and 0 deletions
|
@ -8,6 +8,9 @@ const port = 8090;
|
||||||
//CORS aktivieren
|
//CORS aktivieren
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|
||||||
|
// Füge dies hinzu, um die OPTIONS-Anfragen korrekt zu behandeln
|
||||||
|
app.options('*', cors());
|
||||||
|
|
||||||
// Verwende die Middleware, um POST-Body als JSON zu lesen
|
// Verwende die Middleware, um POST-Body als JSON zu lesen
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue