chore: update codesamples for Vercel v3 adapter (#8111)
This commit is contained in:
parent
7a625d9bad
commit
4967c69221
1 changed files with 7 additions and 9 deletions
|
@ -219,10 +219,9 @@ import vercel from '@astrojs/vercel/serverless';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
output: 'server',
|
output: 'server',
|
||||||
adapter: vercel(),
|
adapter: vercel({
|
||||||
build: {
|
functionPerRoute: true
|
||||||
split: true,
|
}),
|
||||||
},
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -259,7 +258,7 @@ You can use Vercel Edge middleware to intercept a request and redirect before se
|
||||||
|
|
||||||
The `@astrojs/vercel/serverless` adapter can automatically create the Vercel Edge middleware from an Astro middleware in your code base.
|
The `@astrojs/vercel/serverless` adapter can automatically create the Vercel Edge middleware from an Astro middleware in your code base.
|
||||||
|
|
||||||
This is an opt-in feature, and the `build.excludeMiddleware` option needs to be set to `true`:
|
This is an opt-in feature, and the `edgeMiddleware` option needs to be set to `true`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// astro.config.mjs
|
// astro.config.mjs
|
||||||
|
@ -267,10 +266,9 @@ import { defineConfig } from 'astro/config';
|
||||||
import vercel from '@astrojs/vercel';
|
import vercel from '@astrojs/vercel';
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
output: 'server',
|
output: 'server',
|
||||||
adapter: vercel(),
|
adapter: vercel({
|
||||||
build: {
|
edgeMiddleware: true
|
||||||
excludeMiddleware: true,
|
}),
|
||||||
},
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue