Skip to content

Commit 905708c

Browse files
authored
feat: log server url (#11)
1 parent d85e052 commit 905708c

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

lib/runtime.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ export function getEnvOrThrow(key: string): string {
1616
export function serve(
1717
handler: (req: Request) => Response | Promise<Response>,
1818
) {
19-
Deno.serve({ port: 0 }, handler);
19+
Deno.serve(
20+
{
21+
port: 0,
22+
onListen() {
23+
const url = new URL(
24+
getEnvOrThrow("JET_BREEZE_PATH_PREFIX"),
25+
getEnvOrThrow("JET_BREEZE_HOST"),
26+
);
27+
console.log(`Listening on ${url.toString()}`);
28+
},
29+
},
30+
handler,
31+
);
2032
}
2133

2234
function doGetEnv(key: string): string | undefined {

0 commit comments

Comments
 (0)