Comments (1)
I still don't have understandable example of SSR support, because it's very depends on you server-side implementation. But basic example on express
could looks like:
require('svelte/register');
...
const App = require('./App.svelte').default;
...
app.get('*', (req, res) => {
// run router hook
require('svelte-pathfinder/ssr')();
// navigate router to current server URL
goto(req.url);
// render an App with current state
res.render('index', App.render(/* some data */));
});
But I definitely advise everybody to use sveltekit
if you need to take universal approach in your apps.
from svelte-pathfinder.
Related Issues (14)
- goto('/app') returns Uncaught TypeError: Failed to construct 'URL': Invalid URL HOT 2
- Equals sign from the query filter is dropped HOT 3
- Duplicate message in browser history when reload page HOT 1
- Redirect & browser history navbutton HOT 1
- Question: what is the preferred way to remove a query parameter? HOT 1
- Avoid empty query values HOT 6
- Possible to preserve paths on page refresh? HOT 2
- Why page reloads? HOT 5
- Nested routes HOT 14
- $query store prototype HOT 2
- Linking to path with query parameter triggers two history changes HOT 1
- Warning after Vite 5 update
- goto("/") throws Failed to construct 'URL': Invalid URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-pathfinder.