Skip to content

Commit 4ba9062

Browse files
author
Spazcool
committed
Merge branch 'status404'
returns 404 for items not found
2 parents 5799948 + 4056179 commit 4ba9062

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ app.get('/:uuid', (req, res) => {
5959
const matches = searchDatabase(req.params, allItems);
6060
if (matches.length === 0) {
6161
logScanned(req.params.uuid);
62-
res.render('notFound', {
62+
res.status(404).render('notFound', {
6363
item: '',
6464
id: req.params.uuid,
6565
});

views/notFound.ejs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<% include ./partials/header %>
22

3-
<div class="col-xs-12">
4-
<img class="col-xs-12" src="/emoji.png" alt="">
5-
<p>Sorry, item not found with the id:</p>
6-
<p>
7-
<strong><%= id %></strong>
8-
</p>
9-
</div>
3+
<img class="col-xs-12 col-lg-4 col-lg-offset-4" src="/emoji.png" alt="" />
4+
<article style='margin-top:2em'class="col-xs-12 col-lg-4 col-lg-offset-4">
5+
<p>Sorry, item not found with the id:</p>
6+
<p>
7+
<strong><%= id %></strong>
8+
</p>
9+
</article>
1010

1111
<% include ./partials/footer %>

0 commit comments

Comments
 (0)