Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Cors update
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaEPIC committed Nov 26, 2023
1 parent 6d2a254 commit 6c4b6a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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());
Expand Down

0 comments on commit 6c4b6a3

Please sign in to comment.