Next.js is a React framework from Vercel, and is the inspiration for Sapper. There are a few notable differences, however:
src/routes/blog/[slug].svelte
routes
directory. These are just .js
files that export functions corresponding to HTTP methods, and receive Express request
and response
objects as arguments. This makes it very easy to, for example, add a JSON API such as the one powering this very page<a>
elements, rather than framework-specific <Link>
components. That means, for example, that this link right here, despite being inside a blob of HTML, works with the router as you'd expect.