added post backend

This commit is contained in:
Jonas_Jones 2024-06-09 13:35:02 +02:00
parent 85b846f6be
commit 9b28792c91
5 changed files with 96 additions and 16 deletions

View file

@ -1,9 +1,19 @@
import Home from './routes/Home.svelte';
import Post from './routes/Post.svelte';
import Loading from './routes/Loading.svelte';
import NotFound from './routes/NotFound.svelte';
import wrap from 'svelte-spa-router/wrap'
export default {
'/': Home,
'/post/:year/:month/:day/:title': Post,
'/post/:year/:month/:day/:title': wrap({
// Note that this is a function that returns the import
asyncComponent: () => import('./routes/Post.svelte'),
// Show the loading component while the component is being downloaded
loadingComponent: Loading,
// Pass values for the `params` prop of the loading component
loadingParams: {
message: 'Loading the Name route…'
}
}),
'*': NotFound
};