Update CORS

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-07-09 07:18:22 +01:00
parent 6a40ff90d0
commit 6cbf91c775

3
app.js
View File

@ -63,8 +63,7 @@ app.use((err, req, res, next) => {
// Global Middleware: // Global Middleware:
app.use(cors({ app.use(cors({
origin: [/\.owlboard\.info$/, 'localhost'], origin: [/\.owlboard\.info$/, 'localhost:5173', 'localhost:4173']
methods:'GET,POST,OPTIONS'
})); }));
app.use(express.json()); //JSON Parsing for POST Requests app.use(express.json()); //JSON Parsing for POST Requests
app.use(compression()); // Compress API Data if supported by client app.use(compression()); // Compress API Data if supported by client