From 6c4b6a3f44a562ddaacefdefa8ee989e7a4013e1 Mon Sep 17 00:00:00 2001 From: gtaEPIC Date: Sun, 26 Nov 2023 01:08:18 -0500 Subject: [PATCH] Cors update --- config/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/app.js b/config/app.js index 9ad913d..5fab4c3 100644 --- a/config/app.js +++ b/config/app.js @@ -8,6 +8,7 @@ var indexRouter = require('../routes/index'); let ticketRouter = require('../routes/ticketRoute'); var userRegistrationRouter = require('../routes/userRegistration'); let authRouter = require('../routes/authRoutes'); +const cors = require("cors"); var app = express(); @@ -24,6 +25,7 @@ app.use(function(req, res, next) { res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials"); next(); }); +app.options('*', cors()); // Enable preflight for all routes app.use(logger('dev')); app.use(express.json());