Skip to content

Commit

Permalink
refactor(deno): [BREAKING] obsolete app.fire() (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Jul 6, 2022
1 parent 13db469 commit 49025e0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ app.get('/', (c) => {
return c.html(<h1>Hello Deno!</h1>)
})

serve(app.fire())
serve((req) => app.fetch(req))
```

## Related projects
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ app.get('/', (c) => {
return c.html(<h1>Hello Deno!</h1>)
})

serve(app.fire())
serve((req) => app.fetch(req))
```

## Related projects
Expand Down
17 changes: 0 additions & 17 deletions deno_dist/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ declare global {
}
}

interface ConnInfo {
readonly localAddr: Deno.Addr
readonly remoteAddr: Deno.Addr
}

declare module './hono.ts' {
interface Hono {
fire(): (req: Request, connInfo?: ConnInfo) => Response | Promise<Response>
}
}

Hono.prototype.fire = function () {
return (req: Request, _connInfo?: ConnInfo): Response | Promise<Response> => {
return this.request(req)
}
}

export type { Handler, Next } from './hono.ts'
export { Context } from './context.ts'
export type { Env } from './context.ts'
Expand Down
17 changes: 0 additions & 17 deletions src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ declare global {
}
}

interface ConnInfo {
readonly localAddr: Deno.Addr
readonly remoteAddr: Deno.Addr
}

declare module './hono' {
interface Hono {
fire(): (req: Request, connInfo?: ConnInfo) => Response | Promise<Response>
}
}

Hono.prototype.fire = function () {
return (req: Request, _connInfo?: ConnInfo): Response | Promise<Response> => {
return this.request(req)
}
}

export type { Handler, Next } from './hono'
export { Context } from './context'
export type { Env } from './context'
Expand Down

0 comments on commit 49025e0

Please sign in to comment.