feat: move to Deno.serve (#1427)

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
Lino Le Van
2023-07-12 14:37:53 +02:00
committed by GitHub
co-authored by Marvin Hagemeister
parent 46ae49d654
commit e2a1bf8643
24 changed files with 67 additions and 151 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ caching **will** cause your project to not function correctly.
Here is an example `Dockerfile` for a Fresh project:
```dockerfile
FROM denoland/deno:1.33.2
FROM denoland/deno:1.35.0
ARG GIT_REVISION
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}
+6 -2
View File
@@ -100,11 +100,15 @@ export const handler = [
To set the stage for this section, `MiddlewareHandlerContext` looks like this:
```ts
export interface MiddlewareHandlerContext<State = Record<string, unknown>>
extends ConnInfo {
export interface MiddlewareHandlerContext<State = Record<string, unknown>> {
next: () => Promise<Response>;
state: State;
destination: router.DestinationKind;
remoteAddr: {
transport: "tcp" | "udp";
hostname: string;
port: number;
};
}
```
+2 -11
View File
@@ -17,19 +17,10 @@ export async function start(routes: Manifest, opts: StartOptions = {});
things get interesting. `StartOptions` looks like this:
```
export type StartOptions = ServeInit & FreshOptions & {
/**
* UNSTABLE: use the `Deno.serve` API as the underlying HTTP server instead of
* the `std/http` API. Do not use this in production.
*
* This option is experimental and may be removed in a future Fresh release.
*/
experimentalDenoServe?: boolean;
};
export type StartOptions = ServeInit & FreshOptions;
```
You can play around with `Deno.serve` if you'd like, but heed the warning. The
good stuff is really in...
The good stuff is really in...
```ts
export interface FreshOptions {
+1
View File
@@ -23,6 +23,7 @@ below.
| 1.0.0-1.0.2 | >=10.8.1 <11.0.0 | >=5.2.0 <6.0.0 | >= 1.23.0 |
| 1.1.0-1.1.5 | >=10.8.1 <11.0.0 | >=5.2.0 <6.0.0 | >= 1.25.0 |
| 1.2.0 | >=10.15.0 <11.0.0 | >=6.1.0 | >= 1.25.0 |
| 1.3.0 | >=10.15.0 <11.0.0 | >=6.1.0 | >= 1.35.0 |
## Updating dependencies