Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Rich-Harris/sveltekit-on-the-edge
SvelteKit, running on the edge
https://github.com/Rich-Harris/sveltekit-on-the-edge
Last synced: 2 months ago
JSON representation
SvelteKit, running on the edge
- Host: GitHub
- URL: https://github.com/Rich-Harris/sveltekit-on-the-edge
- Owner: Rich-Harris
- Created: 2022-04-20T20:25:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-21T16:15:27.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T17:35:29.052Z (5 months ago)
- Language: Svelte
- Homepage: sveltekit-on-the-edge.vercel.app
- Size: 2.38 MB
- Stars: 217
- Watchers: 8
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-svelte-kit - SvelteKit on Edge(Vercel)
- awesome-sveltekit - [code
README
# SvelteKit on the edge
A demo [SvelteKit](https://kit.svelte.dev) app running on [Vercel Edge Functions](https://vercel.com/features/edge-functions), which run close to your users to enable dynamic server-side rendering at the speed of static content.
## How to enable edge functions in your SvelteKit app deployed to Vercel
- Use your package manager to install [`@sveltejs/adapter-vercel`](https://github.com/sveltejs/kit/tree/master/packages/adapter-vercel)
- Update [svelte.config.js](/svelte.config.js) to use `adapter-vercel` instead of the default `adapter-auto`
- Pass the `runtime: 'edge'` option to the adapter## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev# or start the server and open the app in a new browser tab
npm run dev -- --open
```## Deploying
The easiest way to deploy your app is to link the repo to your Vercel account. Alternatively, you can create a production build locally...
```
npm run build
```...and deploy the prebuilt app to Vercel:
```
vc deploy --prebuilt
```