local-web-server
local-web-server copied to clipboard
Custom 404 page
I'm using local-web-server
to serve a SSG-built Next.js site. Everything's working well except for when I try to access a page that's not found. I'd like to serve the Next.js-generated 404.html
file instead of the bare Not Found
text. Is there a way to do this out of the box with the local-web-server
CLI?
Hi, sorry for the slow reply.. Currently, there is no built-in feature to set a custom 404 response but I think there should be..
It's simple to create a custom 404 response using custom middleware (see the wiki), when I get a few hours spare I'll look into creating an example of how this is done..