Skip to content

Add cors config - #20

Merged
ryanjorgeac merged 1 commit into
mainfrom
feat/prepare-deploy
Jun 29, 2026
Merged

Add cors config#20
ryanjorgeac merged 1 commit into
mainfrom
feat/prepare-deploy

Conversation

@ryanjorgeac

Copy link
Copy Markdown
Owner

This pull request introduces important improvements to the application's environment configuration and startup logic, especially around CORS (Cross-Origin Resource Sharing) and environment variable management. The main changes ensure that the backend only accepts requests from the specified frontend URL and that Prisma client generation is included in the build process.

CORS and Environment Configuration:

  • Added FRONTEND_URL to .env.example to specify the allowed frontend origin for CORS.
  • Updated CORS setup in src/main.ts to use FRONTEND_URL from the environment, restrict allowed methods, and enable credentials, replacing the previous permissive app.enableCors() call. [1] [2]
  • Changed retrieval of the PORT value in src/main.ts to use ConfigService for consistency with other environment variables.

Build Process:

  • Updated the build script in package.json to run prisma generate before building with NestJS, ensuring the Prisma client is always up-to-date.

@ryanjorgeac
ryanjorgeac merged commit a5deaa2 into main Jun 29, 2026
2 checks passed
@ryanjorgeac
ryanjorgeac deleted the feat/prepare-deploy branch June 29, 2026 00:30
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.

1 participant