File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 44 */
55
66const PORT = Bun . env . PORT || 3000 ;
7+ const HOST = Bun . env . HOST || "localhost" ;
78const ALLOWED_ORIGINS = Bun . env . ALLOWED_ORIGINS ?. split ( "," ) || [ "*" ] ;
89const MAX_REDIRECTS = 5 ;
910
@@ -114,6 +115,7 @@ async function proxyRequest(
114115// Main server
115116const server = Bun . serve ( {
116117 port : PORT ,
118+ hostname : HOST ,
117119 async fetch ( req ) {
118120 const url = new URL ( req . url ) ;
119121
@@ -222,6 +224,8 @@ const server = Bun.serve({
222224 } ,
223225} ) ;
224226
225- console . log ( `π CORS Proxy Server running on http://localhost:${ server . port } ` ) ;
226- console . log ( `π Health check: http://localhost:${ server . port } /health` ) ;
227+ console . log (
228+ `π CORS Proxy Server running on http://${ server . hostname } :${ server . port } `
229+ ) ;
230+ console . log ( `π Health check: http://${ server . hostname } :${ server . port } /health` ) ;
227231console . log ( `π Environment: ${ Bun . env . NODE_ENV || "development" } ` ) ;
Original file line number Diff line number Diff line change 99 // See also https://aka.ms/tsconfig/module
1010 "module" : " nodenext" ,
1111 "target" : " esnext" ,
12- "types" : [],
12+ "types" : [
13+ " bun-types"
14+ ],
1315 // For nodejs:
1416 // "lib": ["esnext"],
1517 // "types": ["node"],
You canβt perform that action at this time.
0 commit comments