From: Tim Vaughan Date: Thu, 22 Aug 2019 07:23:58 +0000 (+0200) Subject: Simplified server server-loop X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=843f30f3749a5a47d12446d93c2e364b2956e5a7;p=scratchy.git Simplified server server-loop --- diff --git a/scratchy.scm b/scratchy.scm index 435fe15..0b81523 100644 --- a/scratchy.scm +++ b/scratchy.scm @@ -63,15 +63,15 @@ " on " (seconds->string))) (condition-case (let* ((line (read-line in-port)) - (selector (string-trim-both line))) + (selector-raw (string-trim-both line)) + (selector (if (= (string-length selector-raw) 0) + "/" + selector-raw))) (condition-case (begin (with-output-to-port out-port (lambda () - (serve-selector (if (= (string-length selector) 0) - "/" - selector) - config))) + (serve-selector selector config))) (print "... served selector '" selector "'. Closing connection.")) (o (exn) (print-error-message o out-port)