Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1546

Svelte prerender with 'dynamic' route

$
0
0

I am trying to use svelte SSG because all of my data is fetched from an external API. All of my routes are being generated except for one route because it has parameters. It looks something like this:

"/user/[userId]/code/[code]"

That route is used as email verification. It isn't accessed anywhere in the code because the server sends an email. However, because of the parameters (and I guess because the route is not elsewhere in the code) it will not generate a proper route for that.

I tried putting two examples in 'svelte.config.js' in 'kit.prerender.entries' but it just creates two routes that exactly match the userId and code.

The JS in the page just gets the data from the URL, takes some user input and then makes a fetch request, so it can be prerendered.

Is there any way to have dynamic routes such as this in Svelte SSG or is that just impossible?


Viewing all articles
Browse latest Browse all 1546

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>