DenoDDeno
Powered by
Jasmine Boba'teaJ
Denoβ€’15mo agoβ€’
5 replies
Jasmine Boba'tea

What is the best way to get the full url that Deno.serve() is running on?

If I have:

Deno.serve(
    { port: 1993, hostname: '0.0.0.0' }, 
    (_req) => new Response("Hello, world")
);
Deno.serve(
    { port: 1993, hostname: '0.0.0.0' }, 
    (_req) => new Response("Hello, world")
);


I know the url will be:
http://0.0.0.0:1993
http://0.0.0.0:1993
. Is there something in the
Deno.*
Deno.*
API that I can reference to get it though?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno.serve get full path instead of only params and url
KayKKay / help
3y ago
What is the best way to find the specific npm package available on Deno?
KeiKKei / help
2y ago
What is the best way to count values with Deno.Kv?
Γ“scarÓÓscar / help
3y ago
In Deno, what is the best way to simply host static websites?
abcdef38Aabcdef38 / help
3y ago