Add support for custom 404 document#38
Conversation
Signed-off-by: Thorsten Hans <thorsten.hans@gmail.com>
itowlson
left a comment
There was a problem hiding this comment.
LGTM, just a couple of non-blocking suggestions and clarifications.
|
|
||
| ### Using a custom 404 document | ||
|
|
||
| You can configure a `CUSTOM_404_PATH` environment variable that points to a file that will be served instead of returning a plain 404 Not Found response. If the `CUSTOM_404_PATH` environment variable is not set or points to a non-existing file, the default 404 Not Found response is returned. |
There was a problem hiding this comment.
Possibly worth noting that the custom 404 file has to be included as an asset. (This might not "just happen" if, say, the file server was configured to serve the /images directory instead of the whole site.) And that the path is the mount path inside the fileserver component. (In your example, the source file would have to be test/custom-404.html in order to get mounted as custom-404.html.)
There was a problem hiding this comment.
I've rewritten the paragraph, maybe you can check again @itowlson
Signed-off-by: Thorsten Hans <thorsten.hans@gmail.com>
radu-matei
left a comment
There was a problem hiding this comment.
This looks great, thanks for your contribution, @ThorstenHans!
With this PR
spin-fileservercan be configured to serve a custom 404 document instead of returning the default 404 Not Found response using theCUSTOM_404_PATHenvironment variable.If the path specified in
CUSTOM_404_PATHdoesn't exist, the default 404 Not Found response is returned to the user.