From: Brendan Hansen Date: Sat, 2 Mar 2024 23:25:01 +0000 (+0000) Subject: updated various things X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=2db3d9f4bc49e9782cb2a6cebdd645d6c7d32669;p=onyxlang.io.git updated various things --- diff --git a/onyx-pkg.kdl b/onyx-pkg.kdl index aa0d518..5c4edb3 100644 --- a/onyx-pkg.kdl +++ b/onyx-pkg.kdl @@ -12,8 +12,8 @@ config { } dependencies { - http-server "0.2.30" git="https://github.com/onyx-lang/pkg-http-server" - otmp "0.0.33" git="https://github.com/onyx-lang/pkg-otmp" + http-server "0.3.0" git="https://github.com/onyx-lang/pkg-http-server" + otmp "0.0.34" git="https://github.com/onyx-lang/pkg-otmp" } build { diff --git a/src/app.onyx b/src/app.onyx index 3f8b580..5fc2827 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -23,7 +23,7 @@ reg: otmp.TemplateRegistry; log(.Warning, "Template Renderer", tprintf("{}", s)); } - r.headers["content-type"] = "text/html"; + r.headers["Content-Type"] = "text/html"; r->status(200 if s == .None else 400); r->end(); } @@ -97,8 +97,8 @@ news_articles: Cached_Resource([] Article); article_path := req.url_params["article"] ?? ""; article := array.first(news_articles->get() ?? .[], [n](n.path == article_path)); if !article { - res->status(404); res->render("pages/404", null); + res->status(404); return; } @@ -113,8 +113,8 @@ news_articles: Cached_Resource([] Article); }); } else { - res->status(404); res->render("pages/404", null); + res->status(404); return; } } @@ -179,6 +179,8 @@ main :: () { pipes->pipe((req, res) => { if !res.completed { res->render("pages/404", null); + res->status(404); + res->end(); } }); @@ -190,9 +192,13 @@ main :: () { logger := http.server.logger(style=.V2); pipes->pipe(&logger); - app := http.server.tcp(pipes, .{ thread_count = 4 }); + app := http.server.tcp(pipes, .{ + thread_count = 8, + max_clients = 256 + }); port := conv.parse_int(os.env("SERVER_PORT") ?? "8000"); + logf(.Info, "Listening on {}", port); app->serve(~~port); println("Server stopping..."); diff --git a/www/news-articles/index-backup.json b/www/news-articles/index-backup.json new file mode 100644 index 0000000..3a5d45a --- /dev/null +++ b/www/news-articles/index-backup.json @@ -0,0 +1,14 @@ +[ + { + "name": "Onyx's Memory Model", + "path": "memory_model", + "date": "29th April 2023", + "description": "A explanation of the memory model employed by Onyx." + }, + { + "name": "Onyx's Custom Runtime", + "path": "ovmwasm", + "date": "5th April 2023", + "description": "A brief introduction to OVM-Wasm, Onyx's custom WASM runtime for debugging and portability." + } +] diff --git a/www/templates/pages/404.html b/www/templates/pages/404.html index 80dd35e..3a105d4 100644 --- a/www/templates/pages/404.html +++ b/www/templates/pages/404.html @@ -1,17 +1,8 @@ -{{block "title"}}Onyx - Page not found{{endblock}} + + +
+

404 - Page not found

+
+ + -{{block "content"}} - -
- {% partial "partials/navbar" %} - -
-

404 - Page not found

-
- - {% partial "partials/footer" %} -
- -{{endblock}} - -{{extends "pages/base"}} diff --git a/www/templates/pages/docs/env_setup.html b/www/templates/pages/docs/env_setup.html index 09ecac0..23bd618 100644 --- a/www/templates/pages/docs/env_setup.html +++ b/www/templates/pages/docs/env_setup.html @@ -129,7 +129,7 @@ configs.onyx = { root_dir = function(filename) local utils = require "lspconfig.util" return utils.search_ancestors(filename, function(path) - if utils.path.is_file(utils.path.join(path, "onyx-lsp.ini")) then + if utils.path.is_file(utils.path.join(path, "onyx-lsp.kdl")) then return path end end)