2022-03-25 11:08:02 -05:00
# @astrojs/netlify
Deploy your server-side rendered (SSR) Astro app to [Netlify ](https://www.netlify.com/ ).
2022-04-05 10:25:48 -05:00
Use this adapter in your Astro configuration file, alongside a valid deployment URL:
2022-03-25 11:08:02 -05:00
```js
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';
export default defineConfig({
2022-04-05 10:25:48 -05:00
adapter: netlify(),
// Where your Netlify app will be deployed.
// Feel free to use a local URL (i.e. http://localhost:8080)
// to test local builds via the netlify CLI
site: 'https://my-production-url.netlify.app',
2022-03-25 11:08:02 -05:00
});
```
After you build your site the `netlify/` folder will contain [Netlify Functions ](https://docs.netlify.com/functions/overview/ ) in the `netlify/functions/` folder.
Now you can deploy!
```shell
netlify deploy
```
## Configuration
2022-04-05 10:25:48 -05:00
### dist
We build to a `netlify` directory at the base of your project. To change this, use the `dist` option:
2022-03-25 11:08:02 -05:00
```js
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';
export default defineConfig({
adapter: netlify({
dist: new URL('./dist/', import.meta.url)
})
});
```
And then point to the dist in your `netlify.toml` :
```toml
[functions]
directory = "dist/functions"
```