0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/netlify/src
2022-04-12 20:50:59 +00:00
..
index.ts Make Netlify adapter actually append redirects (#3079) 2022-04-11 12:30:47 -07:00
integration-functions.ts [ci] format 2022-03-25 16:08:51 +00:00
netlify-functions.ts [ci] format 2022-04-12 20:50:59 +00:00
README.md remove site requirement from netlify adapter (#3041) 2022-04-10 14:34:49 -07:00

@astrojs/netlify

Deploy your server-side rendered (SSR) Astro app to Netlify.

Use this adapter in your Astro configuration file, alongside a valid deployment URL:

import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';

export default defineConfig({
	adapter: netlify(),
});

After you build your site the netlify/ folder will contain Netlify Functions in the netlify/functions/ folder.

Now you can deploy!

netlify deploy

Configuration

dist

We build to a netlify directory at the base of your project. To change this, use the dist option:

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:

[functions]
  directory = "dist/functions"