Skip to content

Commit

Permalink
Add a dedicated 404 page
Browse files Browse the repository at this point in the history
Recently (commit 22aa5e9) a refactoring changed the way missing jobs
are handled. Add a quick and simple dedicated 404 page to display
when a user stumbles upon a 404.
  • Loading branch information
tadast committed Jan 22, 2024
1 parent e03673b commit a79f03f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sequenceserver/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Routes < Sinatra::Base
# the results.
get '/:jid' do |jid|
job = Job.fetch(jid)
raise NotFound, 'Job not found' if job.nil?
halt 404, File.read(File.join(settings.root, 'public/404.html')) if job.nil?

erb :report, layout: true
end
Expand Down
27 changes: 27 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>SequenceServer: Not Found</title>

<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>

<body class="bg-light text-dark text-center">

<img src="SequenceServer_logo.png" alt="SequenceServer Logo" class="mt-5 mb-3" style="max-width: 200px">

<div class="container" style="margin-top: 10%">
<h1 class="display-4">404 Not Found</h1>
<p class="lead">Sorry, the page you are looking for could not be found.</p>
<a href="/" class="btn btn-primary mt-3">Start over</a>
</div>

</body>

</html>

0 comments on commit a79f03f

Please # to comment.