Skip to content

Feat/cors - #242

Merged
usmanimamu17-create merged 4 commits into
ApexChainx:mainfrom
memplethee-lab:feat/Cors
Jul 29, 2026
Merged

Feat/cors#242
usmanimamu17-create merged 4 commits into
ApexChainx:mainfrom
memplethee-lab:feat/Cors

Conversation

@memplethee-lab

Copy link
Copy Markdown
Contributor

Closes #149

Description

Type of Change

Related Issue

Closes #151

Testing

Checklist

  • Code follows ApexChain style guidelines
  • Self-review completed
  • Documentation updated
  • Tests pass locally (npm run test)
  • Build passes (npm run build)
  • Lint passes (npm run lint)

Screenshots

Additional Notes

akargi and others added 2 commits July 28, 2026 12:55
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.
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@usmanimamu17-create usmanimamu17-create left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants