File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/auth-server-api/src Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ const app = express();
1111app . use ( express . json ( ) ) ;
1212
1313// CORS configuration
14+ const allowlist = env . CORS_ORIGINS . split ( "," ) . map ( ( origin ) => origin . trim ( ) ) ;
1415const corsOrigins = ( origin : string | undefined , callback : ( err : Error | null , allow ?: boolean ) => void ) => {
15- const allowlist = env . CORS_ORIGINS . split ( "," ) . map ( ( origin ) => origin . trim ( ) ) ;
1616 if ( ! origin || allowlist . indexOf ( origin ) !== - 1 ) {
1717 callback ( null , true ) ;
1818 } else {
@@ -48,4 +48,4 @@ app.use((_req: Request, res: Response) => {
4848 res . status ( 404 ) . json ( { error : "Not found" } ) ;
4949} ) ;
5050
51- export { app , corsOrigins } ;
51+ export { allowlist , app } ;
Original file line number Diff line number Diff line change 11import type { Hex } from "viem" ;
22import { privateKeyToAccount } from "viem/accounts" ;
33
4- import { app , corsOrigins } from "./app.js" ;
4+ import { allowlist , app } from "./app.js" ;
55import { env } from "./config.js" ;
66
77// Start server
88const port = parseInt ( env . PORT , 10 ) ;
99app . listen ( port , ( ) => {
1010 console . log ( `Auth Server API listening on port ${ port } ` ) ;
11- console . log ( `CORS origins: ${ corsOrigins . join ( ", " ) } ` ) ;
11+ console . log ( `CORS origins: ${ allowlist . join ( ", " ) } ` ) ;
1212 console . log ( `Deployer address: ${ privateKeyToAccount ( env . DEPLOYER_PRIVATE_KEY as Hex ) . address } ` ) ;
1313 console . log ( `RPC URL: ${ env . RPC_URL } ` ) ;
1414 console . log ( `Bundler URL: ${ env . BUNDLER_URL } ` ) ;
You can’t perform that action at this time.
0 commit comments