Merge pull request #85 from detleph/main

Merge main into dev before rebasing
This commit is contained in:
La_Felx
2022-06-10 07:31:20 +02:00
committed by GitHub
3 changed files with 13 additions and 4 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
process.env.NODE_ENV = "test";
/*process.env.NODE_ENV = "test";
import chai from "chai";
import chaiHttp from "chai-http";
@@ -81,3 +81,4 @@ describe("events", () => {
});
});
});
*/
+2 -1
View File
@@ -1,4 +1,4 @@
process.env.NODE_ENV = "test";
/*process.env.NODE_ENV = "test";
import chai, { expect } from "chai";
import chaiaspromised from "chai-as-promised";
@@ -15,3 +15,4 @@ describe("mail", () => {
info.accepted.length.should.eq(1);
});
});
*/
+9 -2
View File
@@ -18,6 +18,7 @@ import teamRouter from "./Routes/team.routes";
import roleRouter from "./Routes/role.routes";
import participantRouter from "./Routes/participant.routes";
import { notFoundHandler, rootHandler } from "./Middleware/error/defaultRoutes";
import { env } from "process";
// Set up async error handling
require("express-async-errors");
@@ -50,7 +51,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 +59,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", process.env.DOMAIN);
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
}
// Todo: Everything