Add cors to API endpoints

This commit is contained in:
Fabian Stamm 2018-11-06 21:18:18 +01:00
parent 86110a4272
commit c855083f3e

View File

@ -4,9 +4,11 @@ import UserRoute from "./user";
import InternalRoute from "./internal"; import InternalRoute from "./internal";
import Login from "./user/login"; import Login from "./user/login";
import { AuthGetUser } from "./client/user"; import { AuthGetUser } from "./client/user";
import * as cors from "cors";
const ApiRouter: express.IRouter<void> = express.Router(); const ApiRouter: express.IRouter<void> = express.Router();
ApiRouter.use("/admin", AdminRoute); ApiRouter.use("/admin", AdminRoute);
ApiRouter.use(cors())
ApiRouter.use("/user", UserRoute); ApiRouter.use("/user", UserRoute);
ApiRouter.use("/internal", InternalRoute); ApiRouter.use("/internal", InternalRoute);