File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PORT = 3000
22ALLOWED_ASSETS = " USDC,XLM,ARS"
33
4+ # CORS allowed origins (comma-separated)
5+ CORS_ALLOWED_ORIGINS = " http://localhost:5173"
6+
47# Soroban RPC endpoint for event indexing
58SOROBAN_RPC_URL = https://soroban-testnet.stellar.org:443
69CONTRACT_ID =
Original file line number Diff line number Diff line change 11import "dotenv/config" ;
22
3+ const parseOrigins = ( originsStr : string ) : string [ ] => {
4+ return originsStr
5+ . split ( "," )
6+ . map ( ( s ) => s . trim ( ) )
7+ . filter ( Boolean ) ;
8+ } ;
9+
310export const config = {
411 port : Number ( process . env . PORT ?? 3001 ) ,
512 allowedAssets : ( process . env . ALLOWED_ASSETS ?? "USDC,XLM" )
613 . split ( "," )
714 . map ( ( s ) => s . trim ( ) . toUpperCase ( ) )
815 . filter ( Boolean ) ,
16+ corsAllowedOrigins : parseOrigins (
17+ process . env . CORS_ALLOWED_ORIGINS ?? "http://localhost:5173"
18+ ) ,
919} ;
Original file line number Diff line number Diff line change @@ -41,7 +41,12 @@ type CampaignListItem = ReturnType<typeof calculateProgress> extends infer Progr
4141// Initialize DB
4242initCampaignStore ( ) ;
4343
44- app . use ( cors ( ) ) ;
44+ app . use (
45+ cors ( {
46+ origin : config . corsAllowedOrigins ,
47+ credentials : true ,
48+ } )
49+ ) ;
4550app . use ( express . json ( ) ) ;
4651
4752// Request ID middleware
Original file line number Diff line number Diff line change 1313 "forceConsistentCasingInFileNames" : true ,
1414 "resolveJsonModule" : true ,
1515 "declaration" : true ,
16- "ignoreDeprecations" : " 6.0"
17- },
16+
1817 "include" : [" src/**/*" ],
1918 "exclude" : [" node_modules" , " dist" ]
2019}
You can’t perform that action at this time.
0 commit comments