Matchu
2bc2fc5bfe
Right, the routes are a bit confusing, `/outfits/new` matches `/outfits/:id`, but shouldn't. I fix this at the routing level, by creating a more specific `/outfits/new` route that matches first, and just serves `index.html` right from the CDN. To check that it's exact, I check for either a `?` or the end-of-string after `new`. That way, `/outfits/newish` correctly redirects to the SSR. (This doesn't actually matter a lot, because outfit IDs are only ever numbers and therefore can't start with "new"? But I figure, better to have an unambiguous semantic, then leave random things relying on outfit ID format assumptions.)
13 lines
289 B
JSON
13 lines
289 B
JSON
{
|
|
"routes": [
|
|
{ "src": "/outfits/new(\\?|$)", "dest": "/index.html" },
|
|
{ "src": "/outfits/(?<id>[^/]*)", "dest": "/api/outfitPageSSR.js?id=$id" },
|
|
{
|
|
"handle": "filesystem"
|
|
},
|
|
{
|
|
"src": "/static/js/[^.]*\\.[^.]*\\.chunk.js",
|
|
"status": 404
|
|
}
|
|
]
|
|
}
|