summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2024-03-23 22:27:02 -0500
committerzachir <zachir@librem.one>2024-03-23 22:27:02 -0500
commit5f5aba042b51653dd6a8abcaa082fa5efcffd639 (patch)
tree9396106c65c2c02faa93b611febab6c9b2a7fd7d /src
parent536413d7646844c5bc59d5f10cb833d5e3580643 (diff)
Print some copyright info on server start
Diffstat (limited to 'src')
-rw-r--r--src/main.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index ae53ca6..9b85d30 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -236,6 +236,11 @@ fn run_server(server: *http.Server, allocator: mem.Allocator) !void {
}
}
+pub fn print_info() void {
+ log.info("zhttpd version 0.1.0, Copyright (C) 2024 ZachIR", .{});
+ log.info("zhttpd comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see the included LICENSE for more details", .{});
+}
+
/// main() initializes the server, parses the IP and port, and beings
/// run_server.
/// main() can fail exit from server.listen() and run_server(), which do not
@@ -248,6 +253,8 @@ pub fn main() !void {
defer debug.assert(gpa.deinit() == .ok);
const allocator = gpa.allocator();
+ print_info();
+
// Initialize the server
var server = http.Server.init(allocator, .{ .reuse_address = true });
defer server.deinit();