-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vercel): update middleware esbuild settings (#519)
* fix(vercel): update middleware esbuild settings * Update target
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/vercel': patch | ||
--- | ||
|
||
Updates edge middleware to support esnext syntax |
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
5 changes: 5 additions & 0 deletions
5
packages/vercel/test/fixtures/middleware-with-edge-file/src/middleware.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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
export const hello = async () => 'hello world'; | ||
|
||
const message = await hello(); | ||
|
||
/** | ||
* @type {import("astro").MiddlewareResponseHandler} | ||
*/ | ||
export const onRequest = async (context, next) => { | ||
const test = 'something'; | ||
context.cookies.set('foo', 'bar'); | ||
const response = await next(); | ||
response.headers.set('x-message', message); | ||
return response; | ||
}; |