projects
/
onyxlang.io.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8fa7a39
)
added: 404 to bad pages
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Tue, 2 May 2023 03:25:56 +0000
(22:25 -0500)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Tue, 2 May 2023 03:25:56 +0000
(22:25 -0500)
src/app.onyx
patch
|
blob
|
history
diff --git
a/src/app.onyx
b/src/app.onyx
index ec3d3c30654d63fee0f5474d5c0726dfeccdf037..fb9c79d70c0bb50c0422ea2823d59c192d1322b4 100644
(file)
--- a/
src/app.onyx
+++ b/
src/app.onyx
@@
-43,7
+43,11
@@
news_articles: Cached_Resource([] Article);
@route.{.GET, "/news/:article"}
(req: &Req, res: &Res) {
article := array.first(news_articles->get() ?? .[], #(it.path == req.url_params["article"]));
- if !article do return;
+ if !article {
+ res->status(404);
+ res->render("pages/404", null);
+ return;
+ }
filename := tprintf("www/news-articles/{}.html", article.path);