fix: use await Deno.serve().finished (#1287)
[A recent change in the runtime](https://github.com/denoland/deno/pull/19485) has changed the behaviour of `Deno.serve()` such that it throws when called a promise. The correct way to do it is instead to call `Deno.serve().finished` as a promise. This PR does that. Fixes https://github.com/denoland/fresh/pull/1286#issuecomment-1589987387
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ export async function start(routes: Manifest, opts: StartOptions = {}) {
|
||||
async function bootServer(handler: ServeHandler, opts: StartOptions) {
|
||||
if (opts.experimentalDenoServe === true) {
|
||||
// @ts-ignore as `Deno.serve` is still unstable.
|
||||
await Deno.serve({ ...opts, handler });
|
||||
await Deno.serve({ ...opts, handler }).finished;
|
||||
} else {
|
||||
await serve(handler, opts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user