sholladay / pogo

Server framework for Deno

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] server.start never resolves despite successfully started

KaKi87 opened this issue · comments

Hello,

The code documented here won't work because the promise returned by server.start won't ever resolve, meanwhile, routes work.

Thanks

This is an upstream issue with Deno, unfortunately. I'll document it.

denoland/deno_std#2071

commented

Hello,
I'm sorry to report that this issue wasn't fixed in v0.6.0, and I'm sorry that it took me this long to notice it.
Thanks

The upstream issue still exists, unfortunately, even though they decided to close it.

I suppose we could add on onListen callback to the server options, like they did in std/http. You'd still want to await server.start() so that errors would throw. And the callback doesn't really wait for anything internally. But at least you could run some code when the server is listening.

PR welcome for any implementation that follows the approach in std/http.