My angular app contains percent-encoded routes. Ex. /Page%201
When I run my angular app with ng serve everything works fine.
But when I start the Scully static server and visit "http://localhost:1668/Page%201", the browser shows
Cannot GET /Page%201
I looked into my ./dist/static/assets/scully-routes.json and I can see the ,{"route":"/Page%201"}.
This behavior doesn't happen on routes without space.
Ex. http://localhost:1668/Page2 works just fine.
The scully static server serves files matching the unescaped URI. In your case, when you enter
http://localhost:1668/Page%201, the server will try to find a folder named/Page 1which doesn't exist.Solution 1: Frontend Side
After scully has generated the
dist/staticfolder, rename all escaped name to their unescaped name. Ex./foo%20bar/to/foo bar/.Solution 2: Server Side
Using nginx, I added this line to my
nginx.conf:$uri is escaped and $request_uri is unescaped.
It will try
/foo bar, then/foo bar/and then/foo%20bar/index.htmlwhich will find a match.Advice
If you can, just use ASCII in your urls.