add http-server part 7.9.6 CORS
This commit is contained in:
parent
edf15bbf47
commit
33d4fd94f2
1 changed files with 2 additions and 1 deletions
|
@ -9,7 +9,8 @@ const port = 8090;
|
|||
app.use(cors());
|
||||
|
||||
// Füge dies hinzu, um die OPTIONS-Anfragen korrekt zu behandeln
|
||||
app.options('*', cors());
|
||||
//app.options('*', cors());
|
||||
app.options('/api/command', cors()); // für eine bestimmte Route
|
||||
|
||||
// Verwende die Middleware, um POST-Body als JSON zu lesen
|
||||
app.use(express.json());
|
||||
|
|
Loading…
Reference in a new issue