Correctly respond with 404

This commit is contained in:
2023-02-13 10:37:49 +11:00
parent 10493bca81
commit 73ae37add1
2 changed files with 2 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ module Adamantium
end
def not_found(_req, res, _exception)
res.status = 404
res.render not_found_view
end

View File

@@ -7,6 +7,7 @@ module Adamantium
def handle(req, res)
slug = req.params[:slug]
res.status = File.exist?("app/content/pages/#{slug}.md") ? 200 : 404
res.render show, slug: slug
end
end