sveltekit-reroute
v0.0.2
Published
A SvelteKit handler for redirection rules.
Downloads
7
Readme
sveltekit-reroute
A SvelteKit handler for redirection rules.
This is useful for URL shortening, correcting misspelled words, or for deprecating URLs.
Usage
Install package:
pnpm i -D sveltekit-reroute
Add to src/hooks.server.js
:
import { reroute } from 'sveltekit-reroute'
import { sequence } from '@sveltejs/kit/hooks'
export const handle = sequence([
reroute({
'/github': 'https://github.com/joshnuss',
'/documentation': '/docs'
}),
// more handlers...
])
Similar Packages
License
MIT