Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 15 commits into from
Jan 11, 2024

Conversation

mayura-andrew
Copy link
Member

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

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

N/A

Test environment

Tested on Node.js v20.10.0

Learning

N/A

Copy link
Member

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! @mayura-andrew

@anjula-sack anjula-sack merged commit 6260132 into sef-global:main Jan 11, 2024
1 check failed
@anjula-sack anjula-sack changed the title adding CORS configuration to our Express.js server to allow it to accept requests from 'http://localhost:5173'. Add CORS configuration to our Express.js server to allow it to accept requests from 'http://localhost:5173'. Jan 11, 2024
anjula-sack added a commit to anjula-sack/scholarx-backend that referenced this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing CORS Configuration in Express.js Server
2 participants