fix: some issue after deploying apps#34
Merged
Merged
Conversation
…ent documentation
…script-src directives
…dflare Insights URL
… APP_ORIGIN_HOSTS for consistency
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.
Summary
This PR introduces several improvements and standardizations across both the API and Web applications, focusing on environment variable management, CORS handling, deployment configuration, and security headers. The main goals are to make CORS configuration more flexible, unify environment variable usage, enhance deployment compatibility, and improve security policies.
Key Changes
APP_ORIGIN_URLandOPENAI_API_BASE_URLwithAPP_ORIGIN_HOSTS(comma-separated for CORS origins) andOPENAI_BASE_URL, updating all relevant.envexamples and schemas.connect-srcbased onAPP_API_BASE_URL.boot.jsentry points to ensure consistentdotenvloading and updatedpackage.jsonscripts to use these entry points.vercel.jsonconfiguration for the API application to support seamless deployment on Vercel with specific build and rewrite rules.stripconsole.jsmiddleware using__dirnameto ensure public assets are located correctly.Why this is necessary
As the project scales and moves toward varied deployment environments, the current monolithic and rigid configuration becomes a bottleneck. This update allows for:
boot.jsand dedicated Vercel configurations ensure the apps run consistently regardless of the hosting provider.How to Test
.envfile to replaceAPP_ORIGIN_URLwithAPP_ORIGIN_HOSTS(e.g.,localhost,myapp.com).npm installand thennpm run devornpm startto ensureboot.jscorrectly initializes the environment variables.APP_ORIGIN_HOSTSto verify that headers are being set correctly and debug logs are accurate.Content-Security-PolicyandX-Frame-Optionsreflect the new Helmet configurations.