Walkthrough: Switching to Server-Side Rendering (SSR)
By default, the Next.js sample application uses a route optimized for Static Site Generation (SSG). However, we have also provided a working SSR route you can use: \pages_examples\[[..path]].SSR.tsx
.
This file may be used as a starter for SSR routes in Next.js hybrid (both SSR & SSG) applications or may be used to switch the Next.js sample application to full SSR.
See Next.js documentation to learn more about SSG, SSR, and hybrid modes of pre-rendering.
To switch the Next.js sample application to full SSR:
- Rename the
\pages\[[..path]].tsx
to[[..path]].SSG.tsx
and move to\pages_examples\
- Rename the
\pages_examples\[[..path]].SSR.tsx
to\pages_examples\[[..path]].tsx
and move to\pages\