fix: Fix Vercel deployment routing and theme detection#681
Open
fix: Fix Vercel deployment routing and theme detection#681
Conversation
**Vercel Routing Fixes:** - Add /session route mapping to /api/session - Add /sunoapi/* route mapping to /api/proxy - Add /luma/* route mapping to /api/proxy - Add /viggle/* route mapping to /api/proxy - Add /runwayml/* route mapping to /api/proxy - Ensure all API endpoints are properly proxied in Vercel deployment **Theme Detection Fix:** - Fix SYS_THEME=auto being incorrectly detected as dark theme - Properly handle three theme modes: auto, light, dark - When SYS_THEME=auto, keep auto state for system preference detection - When SYS_THEME=light or dark, force use specified theme **Environment Variables:** - Add OPENAI_API_BASE_URL support in api/session.js for Vercel - Add MJ_SERVER support in api/session.js for Vercel - Add BACKGROUND_IMAGE support in api/session.js - Clean up code formatting (remove trailing spaces) Note: Vercel deployment uses api/session.js instead of service/src/index.ts
|
@inoribea is attempting to deploy a commit to the dooy's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Fix critical issues in Vercel deployment: missing API route mappings and incorrect theme detection when SYS_THEME=auto.
Changes
1. Vercel Routing Fixes (vercel.json)
Add missing API route mappings to ensure all services work properly in Vercel deployment:
/session→/api/sessionmapping/sunoapi/*→/api/proxymapping (Suno music generation)/luma/*→/api/proxymapping (Luma video generation)/viggle/*→/api/proxymapping (Viggle dance video)/runwayml/*→/api/proxymapping (Runway video generation)2. Theme Detection Fix (src/store/modules/auth/index.ts)
Fix SYS_THEME=auto being incorrectly forced to dark theme:
Behavior:
Add support for additional environment variables in Vercel deployment:
Why These Changes Matter
Routing Issues
Without these route mappings, Vercel-deployed instances cannot:
Theme Detection Issue
The previous logic incorrectly treated SYS_THEME=auto as if it was an invalid value, forcing it to dark mode. This prevented users from using automatic theme switching based on system preferences.
Environment Variables
Vercel deployment uses api/session.js instead of service/src/index.ts, so environment variables must be explicitly added here for Vercel deployments to work correctly.