File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2424
2525# --- CORS CONFIGURATION ---
2626# Allows your React app (running on localhost:5173) to talk to this API
27+ # --- FIXED CORS CONFIGURATION ---
2728origins = [
28- "http://localhost:5173" , # Local development
29- "https://arpitkumar-arpitkumar2004s-projects.vercel.app/ " , # Your Vercel URL
30- "https://data-science-portfolio-website-fina.vercel.app/" ,
29+ "http://localhost:5173" ,
30+ "https://arpitkumar-arpitkumar2004s-projects.vercel.app" , # Removed trailing slash
31+ "https://data-science-portfolio-website-fina.vercel.app" , # Removed trailing slash
3132]
3233
3334app .add_middleware (
3435 CORSMiddleware ,
35- allow_origins = origins ,
36+ allow_origins = origins , # Use the list variable we defined above
3637 allow_credentials = True ,
3738 allow_methods = ["*" ],
3839 allow_headers = ["*" ],
40+ # Adding this helps with some browser-specific issues
41+ expose_headers = ["*" ],
3942)
4043
4144# --- Pydantic Schemas for JSON Validation ---
Original file line number Diff line number Diff line change @@ -58,11 +58,11 @@ const Contact: React.FC = () => {
5858 return ( ) => window . removeEventListener ( "role:updated" , onRoleUpdated ) ;
5959 } , [ ] ) ;
6060
61- // 2. Cold-Start Logic: Show notice if request takes > 8 seconds
61+ // 2. Cold-Start Logic: Show notice if request takes > 15 seconds
6262 useEffect ( ( ) => {
6363 let timer : NodeJS . Timeout ;
6464 if ( isSubmitting ) {
65- timer = setTimeout ( ( ) => setShowWakeUpNotice ( true ) , 8000 ) ;
65+ timer = setTimeout ( ( ) => setShowWakeUpNotice ( true ) , 15000 ) ;
6666 } else {
6767 setShowWakeUpNotice ( false ) ;
6868 }
You can’t perform that action at this time.
0 commit comments