astro/packages/integrations/netlify
2022-04-02 19:50:17 +00:00
..
src Migrate to new config (#2962) 2022-04-02 12:29:59 -06:00
CHANGELOG.md [ci] format 2022-04-02 19:50:17 +00:00
package.json [ci] release (#2969) 2022-04-02 13:49:27 -06:00
readme.md Netlify adapter (#2879) 2022-03-25 12:08:02 -04:00
tsconfig.json Netlify adapter (#2879) 2022-03-25 12:08:02 -04:00

@astrojs/netlify

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

Use this adapter in your Astro configuration file:

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

The output folder is configuration with the dist property when creating the adapter.

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"