sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
8 stars 32 forks source link

Add CORS configuration to our Express.js server to allow it to accept requests from 'http://localhost:5173'. #89

Closed mayura-andrew closed 6 months ago

mayura-andrew commented 6 months ago

Purpose

The purpose of this PR is to fix #88

Goals

This PR introduces CORS configuration to our Express.js server, allowing it to accept requests from different origins, perform HTTP methods, and allow session cookies to pass through.

Approach

I've added CORS middleware to our Express.js server and configured it to accept requests from 'http://localhost:5173', allow 'GET, HEAD, PUT, PATCH, DELETE' methods, and set 'credentials' to true to allow session cookies to pass through.

Screenshots

N/A

Checklist

Related PRs

N/A

Test environment

Tested on Node.js v20.10.0

Learning

N/A