}
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 {
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();
}
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;
}
});
} else {
- res->status(404);
res->render("pages/404", null);
+ res->status(404);
return;
}
}
pipes->pipe((req, res) => {
if !res.completed {
res->render("pages/404", null);
+ res->status(404);
+ res->end();
}
});
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...");
--- /dev/null
+[
+ {
+ "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."
+ }
+]
-{{block "title"}}Onyx - Page not found{{endblock}}
+<html>
+ <body>
+ <div style="color: red">
+ <h1>404 - Page not found</h1>
+ </div>
+ </body>
+</html>
-{{block "content"}}
-
-<main>
- {% partial "partials/navbar" %}
-
- <div class="container">
- <h1>404 - Page not found</h1>
- </div>
-
- {% partial "partials/footer" %}
-</main>
-
-{{endblock}}
-
-{{extends "pages/base"}}
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)