Skip to content

Commit

Permalink
some cors changes again
Browse files Browse the repository at this point in the history
  • Loading branch information
if22b088 committed Aug 26, 2024
1 parent 741f92b commit eb04330
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ var app = express();
const corsOptions = {
origin: '*', // Allow requests only from your frontend's origin
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], // Allow these HTTP methods
allowedHeaders: ['Content-Type', 'Authorization'], // Allow these headers
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With'], // Allow these headers
credentials: true // Allow credentials if you are using them (e.g., cookies, authentication)
};
app.use(cors(corsOptions));
app.options('*', cors(corsOptions)); // Handle preflight requests

// view engine setup
app.set('views', path.join(__dirname, 'views'));
Expand Down

0 comments on commit eb04330

Please sign in to comment.