aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.ha12
-rw-r--r--static/style.css2
-rw-r--r--templates/_footer.htmpl2
3 files changed, 13 insertions, 3 deletions
diff --git a/main.ha b/main.ha
index fc41240..d133c7b 100644
--- a/main.ha
+++ b/main.ha
@@ -16,6 +16,7 @@ use memio;
use io;
use fmt;
use bufio;
+use unix::signal;
const usage: [_]getopt::help = [
"Lindenii Forge Server",
@@ -24,7 +25,15 @@ const usage: [_]getopt::help = [
let static_fs: nullable *fs::fs = null;
+let running: bool = true;
+
+export fn sigint_handler(sig: signal::sig, info: *signal::siginfo, ucontext: *opaque) void = {
+ running = false;
+};
+
export fn main() void = {
+ signal::handle(signal::sig::INT, &sigint_handler, signal::flag::NONE, null);
+
const cmd = getopt::parse(os::args, usage...);
defer getopt::finish(&cmd);
@@ -39,6 +48,7 @@ export fn main() void = {
};
static_fs = os::diropen("static")!;
+ defer fs::close(static_fs as *fs::fs);
const server = match (http::listen(ip_addr, port, net::tcp::reuseport, net::tcp::reuseaddr)) {
case let this: *http::server =>
@@ -47,7 +57,7 @@ export fn main() void = {
};
defer http::server_finish(server);
- for (true) {
+ for (running) {
const serv_req = match (http::serve(server)) {
case let this: *http::server_request =>
yield this;
diff --git a/static/style.css b/static/style.css
index e5398ce..a3acd10 100644
--- a/static/style.css
+++ b/static/style.css
@@ -6,7 +6,7 @@
/* Base styles and variables */
html {
- font-family: sans-serif;
+ font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif; /* Yes */
background-color: var(--background-color);
color: var(--text-color);
--radius-1: 0.32rem;
diff --git a/templates/_footer.htmpl b/templates/_footer.htmpl
index a0d1987..71d5318 100644
--- a/templates/_footer.htmpl
+++ b/templates/_footer.htmpl
@@ -5,5 +5,5 @@
{{ " " }}
(<a href="/:/source/">source</a>,
{{ " " }}
-<a href="https://forge.lindenii.runxiyu.org/lindenii/forge/:/repos/server/?branch=hare">upstream</a>)
+<a href="https://forge.lindenii.runxiyu.org/lindenii/forge/:/repos/server/">upstream</a>)
{{ end }}