SvelteKit builds on Svelte with routing, server-side rendering, and API endpoints. File-based routing simplifies navigation. Load functions fetch data server-side. Form actions handle mutations.
Routing and Data
File structure defines routes automatically. Load functions fetch data before rendering. Page and layout data cascade appropriately. Server-only code runs securely.
- Use file-based routing for automatic route generation
- Fetch data in load functions for SSR
- Create API routes with +server.js files
- Handle forms with form actions
- Implement authentication with hooks
Deployment
Adapters target different platforms. Vercel, Netlify, Cloudflare Workers supported. Node adapter runs traditional servers. Static adapter generates static sites.