Skip to content

Commit a1d4dca

Browse files
authored
Merge pull request #719 from tadast/tt/404
Add a dedicated 404 page
2 parents e03673b + 09d92c6 commit a1d4dca

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

lib/sequenceserver/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Routes < Sinatra::Base
137137
# the results.
138138
get '/:jid' do |jid|
139139
job = Job.fetch(jid)
140-
raise NotFound, 'Job not found' if job.nil?
140+
halt 404, File.read(File.join(settings.root, 'public/404.html')) if job.nil?
141141

142142
erb :report, layout: true
143143
end

public/404.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<title>SequenceServer: Not Found</title>
9+
10+
<!-- Bootstrap CSS -->
11+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
12+
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
13+
</head>
14+
15+
<body class="bg-light text-dark text-center">
16+
17+
<img src="SequenceServer_logo.png" alt="SequenceServer Logo" class="mt-5 mb-3" style="max-width: 200px;">
18+
19+
<div class="container" style="margin-top: 10%;">
20+
<h1 class="display-4">404 Not Found</h1>
21+
<p class="lead">Sorry, the page you are looking for could not be found.</p>
22+
<a href="/" class="btn btn-primary mt-3">Start over</a>
23+
</div>
24+
25+
</body>
26+
27+
</html>

0 commit comments

Comments
 (0)