mirror of
https://github.com/detleph/server.git
synced 2026-09-04 00:26:03 +02:00
FIX: cors having stroke
This commit is contained in:
+8
-2
@@ -50,7 +50,7 @@ async function main() {
|
||||
logger.info("Using production mode");
|
||||
|
||||
// Configure cors
|
||||
app.use(
|
||||
/*app.use(
|
||||
cors({
|
||||
origin: process.env.ALLOW_ORIGIN,
|
||||
allowedHeaders: ["Content-Type", "Authorization"],
|
||||
@@ -58,7 +58,13 @@ async function main() {
|
||||
methods: ["GET", "PUT", "PATCH", "POST", "DELETE"],
|
||||
optionsSuccessStatus: 204,
|
||||
})
|
||||
);
|
||||
);*/
|
||||
//Cors is for some reason broken on our server so set the Cors headers manually
|
||||
app.use(function (req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", "https://josport.at");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
||||
// Todo: Everything
|
||||
|
||||
Reference in New Issue
Block a user