Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run server.init() for edge functions on Vercel #6327

Merged
merged 8 commits into from
Aug 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changes
  • Loading branch information
Rich-Harris committed Aug 26, 2022
commit 040451e0e7cbd95fbd8ebca2507854588003af4e
2 changes: 1 addition & 1 deletion .changeset/strong-kangaroos-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@sveltejs/adapter-vercel': minor
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
---

Run server.init() for edge functions. Closes #6308.
Run `server.init()` for edge functions
8 changes: 4 additions & 4 deletions packages/adapter-vercel/files/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { manifest } from 'MANIFEST';

const server = new Server(manifest);

await server.init({
env: process.env
});

/**
* @param {Request} request
*/
export default async (request) => {
await server.init({
env: process.env
});

return server.respond(request, {
getClientAddress() {
return request.headers.get('x-forwarded-for');
Expand Down