18 lines
464 B
Svelte
18 lines
464 B
Svelte
|
<script>
|
||
|
import Router from 'svelte-spa-router'
|
||
|
import Index from './routes/Index.svelte'
|
||
|
import Post from './routes/Post.svelte'
|
||
|
|
||
|
import NotFound from './routes/error/NotFound.svelte'
|
||
|
import Button from "../Components/Button.svelte";
|
||
|
|
||
|
const routes = {
|
||
|
// Exact path
|
||
|
'/': Index,
|
||
|
// Using named parameters, with last being optional
|
||
|
'/post/:id': Post,
|
||
|
'*': NotFound,
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<Router {routes}/>
|