Feat/cors - #242
Merged
Merged
Conversation
This commit introduces Sentry for application monitoring and updates the Next.js project configuration. Key changes include: - Integrated Sentry for error tracking and performance monitoring across client, server, and edge environments. - Added Sentry-specific configuration files (`sentry.client.config.ts`, `sentry.server.config.ts`, `sentry.edge.config.ts`, `sentry.properties`). - Migrated the Next.js configuration from `next.config.ts` to `next.config.mjs`. - Introduced the `pages/` directory. - Updated `.gitignore` to handle new configurations. - Modified the E2E testing workflow to align with the updated project structure. - Removed the `.env.example` file.
Problem: The frontend client forces withCredentials: true for all API requests, but the backend did not have a corresponding CORS configuration to handle this. This would cause requests from different origins to fail. Solution: Modified next.config.mjs to dynamically configure CORS headers for API routes. The Access-Control-Allow-Origin header is now populated from the CORS_ALLOWLIST environment variable, which should contain a comma-separated list of allowed origins. The Access-Control-Allow-Credentials header is set to true to support credentialed requests. Updated docs/API.md to document the new CORS_ALLOWLIST environment variable and provide an example for developers. This change allows for flexible configuration of allowed origins for different environments (e.g., localhost, staging, production) directly through environment variables.
|
@memplethee-lab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #149
Description
Type of Change
Closes [Infrastructure] Add production build verification artifact #150
Related Issue
Closes #151
Testing
Closes [Infrastructure] Add Dockerfile + docker-compose for local dev #148
Checklist
npm run test)npm run build)npm run lint)Screenshots
Additional Notes