mirror of
https://github.com/detleph/server.git
synced 2026-09-04 00:26:03 +02:00
Merge pull request #85 from detleph/main
Merge main into dev before rebasing
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
process.env.NODE_ENV = "test";
|
/*process.env.NODE_ENV = "test";
|
||||||
|
|
||||||
import chai from "chai";
|
import chai from "chai";
|
||||||
import chaiHttp from "chai-http";
|
import chaiHttp from "chai-http";
|
||||||
@@ -81,3 +81,4 @@ describe("events", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
process.env.NODE_ENV = "test";
|
/*process.env.NODE_ENV = "test";
|
||||||
|
|
||||||
import chai, { expect } from "chai";
|
import chai, { expect } from "chai";
|
||||||
import chaiaspromised from "chai-as-promised";
|
import chaiaspromised from "chai-as-promised";
|
||||||
@@ -15,3 +15,4 @@ describe("mail", () => {
|
|||||||
info.accepted.length.should.eq(1);
|
info.accepted.length.should.eq(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
+9
-2
@@ -18,6 +18,7 @@ import teamRouter from "./Routes/team.routes";
|
|||||||
import roleRouter from "./Routes/role.routes";
|
import roleRouter from "./Routes/role.routes";
|
||||||
import participantRouter from "./Routes/participant.routes";
|
import participantRouter from "./Routes/participant.routes";
|
||||||
import { notFoundHandler, rootHandler } from "./Middleware/error/defaultRoutes";
|
import { notFoundHandler, rootHandler } from "./Middleware/error/defaultRoutes";
|
||||||
|
import { env } from "process";
|
||||||
|
|
||||||
// Set up async error handling
|
// Set up async error handling
|
||||||
require("express-async-errors");
|
require("express-async-errors");
|
||||||
@@ -50,7 +51,7 @@ async function main() {
|
|||||||
logger.info("Using production mode");
|
logger.info("Using production mode");
|
||||||
|
|
||||||
// Configure cors
|
// Configure cors
|
||||||
app.use(
|
/*app.use(
|
||||||
cors({
|
cors({
|
||||||
origin: process.env.ALLOW_ORIGIN,
|
origin: process.env.ALLOW_ORIGIN,
|
||||||
allowedHeaders: ["Content-Type", "Authorization"],
|
allowedHeaders: ["Content-Type", "Authorization"],
|
||||||
@@ -58,7 +59,13 @@ async function main() {
|
|||||||
methods: ["GET", "PUT", "PATCH", "POST", "DELETE"],
|
methods: ["GET", "PUT", "PATCH", "POST", "DELETE"],
|
||||||
optionsSuccessStatus: 204,
|
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
|
// Todo: Everything
|
||||||
|
|||||||
Reference in New Issue
Block a user