diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Resources/Views/404.leaf b/Resources/Views/404.leaf new file mode 100644 index 0000000..032115b --- /dev/null +++ b/Resources/Views/404.leaf @@ -0,0 +1,24 @@ + + + + Not Found + + + + + + +
+
+
+
404
+

This page wasn't found on our server

+

Either the page was removed or you clicked on a bad link…

+ + Go back + +
+
+
+ + diff --git a/Resources/Views/serverError.leaf b/Resources/Views/serverError.leaf new file mode 100644 index 0000000..5b1261c --- /dev/null +++ b/Resources/Views/serverError.leaf @@ -0,0 +1,31 @@ + + + + + #(statusMessage) + + + + + + +
+
+
+
#(status)
+

+ #if(reason ?? false): + #(reason) + #else: + #(statusMessage) + #endif +

+

If you have done everything properly, please try again later…

+ + Go back + +
+
+
+ + \ No newline at end of file diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 09f09a7..def716c 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -4,9 +4,9 @@ import LeafErrorMiddleware // configures your application public func configure(_ app: Application) throws { + app.middleware.use(LeafErrorMiddleware()) // Serve files from /Public app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory)) - app.middleware.use(LeafErrorMiddleware()) // Configure Leaf LeafOption.caching = app.environment.isRelease ? .default : .bypass