0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

[docs] update adapter READMESs to include astro add (#4595)

* update adapter READMES to include astro add

* missing space

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
This commit is contained in:
Sarah Rainsberger 2022-09-06 09:53:47 -03:00 committed by GitHub
parent 0524d55e45
commit c9b9c91252

View file

@ -22,24 +22,31 @@ If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/gui
## Installation
First, install the `@astrojs/vercel` package using your package manager. If you're using npm or aren't sure, run this in the terminal:
```sh
npm install @astrojs/vercel
Add the Vercel adapter to enable SSR in your Astro project with the following `astro add` command. This will install the adapter and make the appropriate changes to your `astro.config.mjs` file in one step.
```bash
npx astro add vercel
```
Then, install this adapter in your `astro.config.*` file using the `deploy` property (note the import from `@astrojs/vercel/serverless` - see [targets](#targets)).
If you prefer to install the adapter manually instead, complete the following two steps:
__`astro.config.mjs`__
1. Install the Vercel adapter to your projects dependencies using your preferred package manager. If youre using npm or arent sure, run this in the terminal:
```js
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
```bash
npm install @astrojs/vercel
```
export default defineConfig({
1. Add two new lines to your `astro.config.mjs` project configuration file.
```js title="astro.config.mjs" ins={2, 5-6}
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/vercel/serverless';
export default defineConfig({
output: 'server',
adapter: vercel()
});
```
adapter: vercel(),
});
```
### Targets