-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug/issue 1329 pass custom runtime to API routes for Vercel adapter (#…
- Loading branch information
1 parent
0f4d656
commit 37a3b90
Showing
3 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../plugin-adapter-vercel/test/cases/build.default.options-runtime/src/pages/api/greeting.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export async function handler(request) { | ||
const params = new URLSearchParams(request.url.slice(request.url.indexOf('?'))); | ||
const name = params.has('name') ? params.get('name') : 'World'; | ||
const body = { message: `Hello ${name}!` }; | ||
|
||
return new Response(JSON.stringify(body), { | ||
headers: new Headers({ | ||
'Content-Type': 'application/json' | ||
}) | ||
}); | ||
} |