summaryrefslogtreecommitdiff
path: root/.changeset/mighty-shoes-scream.md
blob: adacd6ecaa70ce293fbc29381c2dbdca8d509454 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
'astro': minor
'@astrojs/cloudflare': patch
'@astrojs/netlify': patch
'@astrojs/vercel': patch
'@astrojs/image': patch
'@astrojs/deno': patch
'@astrojs/node': patch
---

Enable experimental support for hybrid SSR with pre-rendering enabled by default

__astro.config.mjs__
 ```js
import { defineConfig } from 'astro/config';
export defaultdefineConfig({
    output: 'hybrid',
        experimental: {
        hybridOutput: true,
    },
})
 ```
Then add `export const prerender =  false` to any page or endpoint you want to opt-out of pre-rendering.

__src/pages/contact.astro__
```astro
---
export const prerender = false

if (Astro.request.method === 'POST') {
    // handle form submission
}
---
<form method="POST">
    <input type="text" name="name" />
    <input type="email" name="email" />
    <button type="submit">Submit</button>
</form>
```