cli: support catch all routes (i.e. to a custom 404 page)
See original GitHub issueSteps to Reproduce
ng add @scullyio/init
npm i --save-dev fs-extra
ng build
npm run scully
Error
Cleaned up /Users/splaktar/Git/.../dist/static/ folder.
started servers in background
Invalid content-type.
Expected application/json but received text/html; charset=UTF-8
<repeated about 30 times>
Invalid content-type.
Expected application/json but received text/html; charset=UTF-8
Could not connect to server
The debugger indicates that this is caused by the following line https://github.com/scullyio/scully/blob/eba6fba6a5df182137fdb7b434893162bc962dc3/scully/utils/waitForServerToBeAvailable.ts#L13
That URL (http://localhost:1864/_pong
) seems to be returning my Angular app (in a broken state) rather than some JSON
content.
Root Cause
A route like {path: '**', component: PageNotFoundComponent}
breaks the ability to run Scully. Removing it works around the problem, but breaks the app’s custom 404 page.
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (14 by maintainers)
Top Results From Across the Web
How to make a catch all route to handle '404 page not found ...
I got my error handling to work by creating an ErrorController that returns the views in this article. I also had to add...
Read more >Using a culture constraint and redirecting 404s with the url ...
In this post, I'll show how we can create a custom route constraint to help prevent invalid route matching, and add additional routes...
Read more >Routing in ASP.NET Core - Microsoft Learn
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >How to Craft the Best 404 Pages for your Clients - Shopify
A good custom 404 page will help people find the information ... to avoid any confusion, with a search bar and links to...
Read more >Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. ... Catch all routes can be made optional by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
@Splaktar Yes, a partial fix might be in a bit earlier, but that one closed it completely.
@SanderElias Are you able to share your PR? I’d like to test it if I can.