Next.js
React framework with server-side rendering and static generation.
// pages/index.js
export default function Home() {
return <h1>Hello, Next.js!</h1>;
}
// pages/api/hello.js
export default function handler(req, res) {
res.status(200).json({name: "John"});
}
Summary
- Next.js adds SSR and SSG to React
- File-based routing in pages/ directory
YouTip