Add error pages
This commit is contained in:
		@@ -1,7 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<Workspace
 | 
					 | 
				
			||||||
   version = "1.0">
 | 
					 | 
				
			||||||
   <FileRef
 | 
					 | 
				
			||||||
      location = "self:">
 | 
					 | 
				
			||||||
   </FileRef>
 | 
					 | 
				
			||||||
</Workspace>
 | 
					 | 
				
			||||||
							
								
								
									
										24
									
								
								Resources/Views/404.leaf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Resources/Views/404.leaf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					<!DOCTYPE html>
 | 
				
			||||||
 | 
					<html lang="en">
 | 
				
			||||||
 | 
					  <head>
 | 
				
			||||||
 | 
					    <title>Not Found</title>
 | 
				
			||||||
 | 
					    <link rel="stylesheet" type="text/css" href="/tabler/css/tabler.css">
 | 
				
			||||||
 | 
					    <link rel="stylesheet" type="text/css" href="/tabler/css/dashboard.css">
 | 
				
			||||||
 | 
					    <script src="/tabler/js/core.js"></script>
 | 
				
			||||||
 | 
					    <script src="/tabler/js/dashboard.js"></script>
 | 
				
			||||||
 | 
					  </head>
 | 
				
			||||||
 | 
					  <body class="">
 | 
				
			||||||
 | 
					    <div class="page">
 | 
				
			||||||
 | 
					      <div class="page-content">
 | 
				
			||||||
 | 
					        <div class="container text-center">
 | 
				
			||||||
 | 
					          <div class="display-1 text-muted mb-5"><i class="si si-exclamation"></i> 404</div>
 | 
				
			||||||
 | 
					          <h1 class="h2 mb-3">This page wasn't found on our server</h1>
 | 
				
			||||||
 | 
					          <p class="h4 text-muted font-weight-normal mb-7">Either the page was removed or you clicked on a bad link…</p>
 | 
				
			||||||
 | 
					          <a class="btn btn-primary" href="javascript:history.back()">
 | 
				
			||||||
 | 
					            <i class="fe fe-arrow-left mr-2"></i>Go back
 | 
				
			||||||
 | 
					          </a>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
							
								
								
									
										31
									
								
								Resources/Views/serverError.leaf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								Resources/Views/serverError.leaf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					<!doctype html>
 | 
				
			||||||
 | 
					<!DOCTYPE html>
 | 
				
			||||||
 | 
					<html lang="en">
 | 
				
			||||||
 | 
					  <head>
 | 
				
			||||||
 | 
					    <title>#(statusMessage)</title>
 | 
				
			||||||
 | 
					    <link rel="stylesheet" type="text/css" href="/tabler/css/tabler.css">
 | 
				
			||||||
 | 
					    <link rel="stylesheet" type="text/css" href="/tabler/css/dashboard.css">
 | 
				
			||||||
 | 
					    <script src="/tabler/js/core.js"></script>
 | 
				
			||||||
 | 
					    <script src="/tabler/js/dashboard.js"></script>
 | 
				
			||||||
 | 
					  </head>
 | 
				
			||||||
 | 
					  <body class="">
 | 
				
			||||||
 | 
					    <div class="page">
 | 
				
			||||||
 | 
					      <div class="page-content">
 | 
				
			||||||
 | 
					        <div class="container text-center">
 | 
				
			||||||
 | 
					          <div class="display-1 text-muted mb-5"><i class="si si-exclamation"></i> #(status)</div>
 | 
				
			||||||
 | 
					          <h1 class="h2 mb-3">
 | 
				
			||||||
 | 
					            #if(reason ?? false):
 | 
				
			||||||
 | 
					              #(reason)
 | 
				
			||||||
 | 
					            #else:
 | 
				
			||||||
 | 
					              #(statusMessage)
 | 
				
			||||||
 | 
					            #endif
 | 
				
			||||||
 | 
					          </h1>
 | 
				
			||||||
 | 
					          <p class="h4 text-muted font-weight-normal mb-7">If you have done everything properly, please try again later…</p>
 | 
				
			||||||
 | 
					          <a class="btn btn-primary" href="javascript:history.back()">
 | 
				
			||||||
 | 
					            <i class="fe fe-arrow-left mr-2"></i>Go back
 | 
				
			||||||
 | 
					          </a>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
@@ -4,9 +4,9 @@ import LeafErrorMiddleware
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// configures your application
 | 
					// configures your application
 | 
				
			||||||
public func configure(_ app: Application) throws {
 | 
					public func configure(_ app: Application) throws {
 | 
				
			||||||
 | 
					    app.middleware.use(LeafErrorMiddleware())
 | 
				
			||||||
    // Serve files from /Public
 | 
					    // Serve files from /Public
 | 
				
			||||||
    app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
 | 
					    app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
 | 
				
			||||||
    app.middleware.use(LeafErrorMiddleware())
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Configure Leaf
 | 
					    // Configure Leaf
 | 
				
			||||||
    LeafOption.caching = app.environment.isRelease ? .default : .bypass
 | 
					    LeafOption.caching = app.environment.isRelease ? .default : .bypass
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user