aboutsummaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.ha5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.ha b/main.ha
index 58e467b..fc41240 100644
--- a/main.ha
+++ b/main.ha
@@ -2,6 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
// Adapted from template by Willow Barraco <contact@willowbarraco.fr>
+use fs;
use getopt;
use log;
use net;
@@ -21,6 +22,8 @@ const usage: [_]getopt::help = [
('c', "config", "path to configuration file")
];
+let static_fs: nullable *fs::fs = null;
+
export fn main() void = {
const cmd = getopt::parse(os::args, usage...);
defer getopt::finish(&cmd);
@@ -35,6 +38,8 @@ export fn main() void = {
};
};
+ static_fs = os::diropen("static")!;
+
const server = match (http::listen(ip_addr, port, net::tcp::reuseport, net::tcp::reuseaddr)) {
case let this: *http::server =>
yield this;