A SvelteKit 3 starter in TypeScript with Svelte 5, rendering on the server through adapter-node, for developers who want a SvelteKit app that runs in any container. It includes a server load function, an About page, a GET /api/health endpoint, ESLint, svelte-check and Vitest.
by Light CloudFull-stack


For each request to /, the server runs the load function, renders the page with its data and sends HTML that Svelte then hydrates in the browser. The starter uses adapter-node because adapter-auto only recognises a fixed list of hosts, while a Node.js server runs anywhere. Most people first add routes in src/routes/ with their own +page.server.ts loads, and keep secrets in $app/env/private. SvelteKit and Vitest share one vite.config.ts, and deploying runs npm run build, then npm start (node build) in a container that listens on PORT.
adapter-auto only recognises a fixed list of hosting platforms. adapter-node builds a standard Node.js server that runs in any container.
Create a folder in src/routes/ with a +page.svelte in it, such as src/routes/contact/+page.svelte for /contact, and add a +page.server.ts next to it for data loaded on the server.
Create a +server.ts file and export a function per HTTP method, as in src/routes/api/health/+server.ts. src/routes/api/hello/+server.ts with export const GET answers GET /api/hello.
Declare each variable in src/env.ts with defineEnvVars, then import it from $app/env/private in server code, or from $app/env/public when it is marked public: true. Variables are read when the server starts, not at build time, unless you mark them static: true.
Yes. Any host with Node.js 22.17 or later runs it with npm run build and node build, or you can swap adapter-node for another platform's adapter in vite.config.ts.