File not found middleware for the Website service (#4)
This PR contains the work done to add a `NotFoundMiddleware` middleware to the Website service so requests matching neither a route nor a static file return a custom 404.html page with a 404 Not Found status. Also enables index.html fallback so the landing page is served at the site root. To provider further details about the work done: * NotFoundMiddleware — intercepts the `.notFound` error from the `FileMiddleware` middleware and serves the preloaded error page with the correct content type; all other errors propagate. Falls back to a minimal body if the file is missing. * Router — wires the `NotFoundMiddleware` middleware ahead of the `FileMiddleware` and enables searchForIndexHtml. * Package — adds the **Hummingbird** product to the Library target. * Tooling — sets a custom working directory in the Xcode scheme; removes the unused `pkg-deps` target from the `Makefile` file. Reviewed-on: rock-n-code/loud-amsterdam#4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit is contained in:
@@ -41,10 +41,6 @@ pkg-clean: ## Remove the Swift build artifacts
|
||||
pkg-reset: ## Resets the complete SPM cache/build folder
|
||||
@swift package reset
|
||||
|
||||
.PHONY: pkg-deps
|
||||
pkg-deps: ## Lists the SPM package dependencies
|
||||
@swift package show-dependencies
|
||||
|
||||
.PHONY: pkg-outdated
|
||||
pkg-outdated: ## Lists the SPM package dependencies that can be updated
|
||||
@swift package update --dry-run
|
||||
|
||||
Reference in New Issue
Block a user