diff options
| author | 2022-04-06 16:21:46 -0400 | |
|---|---|---|
| committer | 2022-04-06 16:21:46 -0400 | |
| commit | 672a553eccbc3a9e9bc7bd9ecce6f60c45b8b0c9 (patch) | |
| tree | d902da8628e4de429286f4b73aa80d454a5c8a18 /packages/integrations/netlify/src | |
| parent | 10bc76a139622e63caa81f072b87843cc66f9e0a (diff) | |
| download | astro-672a553eccbc3a9e9bc7bd9ecce6f60c45b8b0c9.tar.gz astro-672a553eccbc3a9e9bc7bd9ecce6f60c45b8b0c9.tar.zst astro-672a553eccbc3a9e9bc7bd9ecce6f60c45b8b0c9.zip | |
Fix Netlify adapter and dynamic routes (#3011)
* Fix Netlify adapter and dynamic routes
* Changeset
Diffstat (limited to 'packages/integrations/netlify/src')
| -rw-r--r-- | packages/integrations/netlify/src/index.ts | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/packages/integrations/netlify/src/index.ts b/packages/integrations/netlify/src/index.ts index 181303e33..aa1b5d33c 100644 --- a/packages/integrations/netlify/src/index.ts +++ b/packages/integrations/netlify/src/index.ts @@ -53,6 +53,10 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat  					if (route.pathname) {  						_redirects += `  ${route.pathname}    /.netlify/functions/${entryFile}    200`; +					} else { +						const pattern = '/' + route.segments.map(([part]) => part.dynamic ? '*' : part.content).join('/'); +						_redirects += ` +${pattern}    /.netlify/functions/${entryFile}    200`;  					}  				} | 
