Skip to content

Commit

Permalink
Switch deprecated Now types to Vercel types
Browse files Browse the repository at this point in the history
  • Loading branch information
n4bb12 committed Sep 19, 2023
1 parent 0a60be6 commit 7d73e04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/fastify-lambda.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { NowApiHandler, NowRequest, NowResponse } from "@vercel/node"
import { VercelApiHandler, VercelRequest, VercelResponse } from "@vercel/node"
import { FastifyInstance } from "fastify"

//
// https://www.fastify.io/docs/latest/Serverless/#vercel
// https://vercel.com/docs/serverless-functions/supported-languages#using-typescript
//
export const createLambdaHandler: (server: FastifyInstance) => NowApiHandler = (
export const createLambdaHandler: (server: FastifyInstance) => VercelApiHandler = (
server,
) => {
return async (req: NowRequest, res: NowResponse) => {
return async (req: VercelRequest, res: VercelResponse) => {
await server.ready()
server.server.emit("request", req, res)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NowApiHandler } from "@vercel/node"
import { VercelApiHandler } from "@vercel/node"
import fastify from "fastify"
import assert from "ow"

Expand All @@ -8,7 +8,7 @@ import { registerServeStatic } from "./fastify-static"
import { registerGitHubOAuth } from "./github-oauth"
import { Config } from "./types"

export const createLambdaProxyAuthHandler: (config: Config) => NowApiHandler = (
export const createLambdaProxyAuthHandler: (config: Config) => VercelApiHandler = (
config,
) => {
assert(config.cryptoSecret, "config.cryptoSecret", assert.string.nonEmpty)
Expand Down

0 comments on commit 7d73e04

Please sign in to comment.