Fix port number type and log to stderr by default
authorSiraaj Khandkar <siraaj@khandkar.net>
Wed, 19 Apr 2023 18:01:35 +0000 (14:01 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Wed, 19 Apr 2023 18:01:35 +0000 (14:01 -0400)
home/bin/websrv

index 6076e4f..d4288df 100755 (executable)
@@ -11,7 +11,7 @@
 
 (module+ main
   (let* ([program (path->string (find-system-path 'run-file))]
-         [log-file (string-append program ".log")]
+         [log-file (current-error-port)]
          [listen-addr "0.0.0.0"]
          [listen-port 8000]
          [paths-to-serve '()]
@@ -27,9 +27,9 @@
        (set! listen-addr ip-addr)]
       [("-p" "--port")
        port-number "Listen port."
-       (set! listen-port port-number)]
+       (set! listen-port (string->number port-number))]
       [("-l" "--log")
-       file "Log file."
+       file "Log file [default: stderr]."
        (set! log-file file)]
       #:args (path . paths)
       (set! paths-to-serve (cons path paths)))
This page took 0.03061 seconds and 4 git commands to generate.