Skip to content

How do people deploy static sites built on react and vite with wouter ? #322

Closed Answered by molefrog
ymolists asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ymolists, thank you for your kind words!

You probably have one index.html file at the root of your static folder and it's expectable that the web server can't serve any other route except for / because it looks for actual static html files. For example, when you request /about the web server tries to locate /about/index.html (which isn't there ofc). You need to setup your web server so that it supports an "SPA wildcard routing" which will return your index.html for all routes that it doesn't know about.

I'm not familiar with Python's web server, but here is a pretty decent recipe from chat gpt:

To serve a static single-page application (SPA) with Python and support SPA routes, you can…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ymolists
Comment options

Answer selected by ymolists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants