SvelteKit · Gateway Implementation

SvelteKit with KERNSTACK gateway

The gateway is where a SvelteKit site meets the internet on KERNSTACK: prefix routes serve the app from its bucket, custom domains attach with path prefixes (up to ten per hostname, one route owning the root), canonical redirects keep a single URL per page, and API routes can demand a key. All of it is declared, so moving the marketing site, the app, and the docs between hostnames is a manifest edit with a plan.

SvelteKit Gateway

The hostname rules encode lessons teams learn the hard way: exactly one route owns a hostname’s root, additional routes take path prefixes, and moving a hostname to another stack requires --allow-domain-takeover at deploy — an explicit act, never a side effect of someone else’s deploy. The plan shows the binding before it happens.

URL hygiene is defaulted, not configured: alternate .html and slash spellings redirect (301) to the canonical path, and non-canonical aliases can be blocked outright. For an SEO-sensitive SvelteKit site this removes a class of duplicate-URL accidents that usually surface months later in Search Console.

The same block fronts the app’s dynamic half. Marking the API route private makes it demand one of the declared API keys — the raw key prints once at first deploy and is referenced in code as a ref-api-key value — so the public site and the keyed API share a hostname strategy in the same reviewable file.

CLI

Plan SvelteKit Gateway, then deploy.

Terminal — CLI workflow kernstack cli
kernstack plan
kernstack plan
kernstack deploy

Docs for SvelteKit Gateway. Gateway on the platform.

Frequently asked questions

One CNAME to dmns.kernstack.com, which the deploy output prints. The hostname must be declared in the route first; removing it later needs the destructive-change confirmation, by design.

Yes: up to ten path_prefix routes per hostname. A common split is the SvelteKit app at the root, docs under /docs, and a function-backed API under /api — three routes, one certificate story owned by the platform.

Canonical redirects are on by default for prefix routes: alternate spellings get a 301 to the canonical URL, and block_alias_url can hard-block non-canonical forms for strict estates.

Ship your stack on the Software Lifecycle Cloud.

Closed preview on dedicated European infrastructure. Bring a repository or start from a blueprint.