From 511c3a0c20ee6cecf9b61e74a8905f722157afb7 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 5 Mar 2013 16:00:12 -0700 Subject: [PATCH] parameterizing the port --- whalesong/repl-prototype/server.rkt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/whalesong/repl-prototype/server.rkt b/whalesong/repl-prototype/server.rkt index 0df4a70..d0b08b3 100644 --- a/whalesong/repl-prototype/server.rkt +++ b/whalesong/repl-prototype/server.rkt @@ -1,7 +1,5 @@ #lang racket/base - - (require "repl-compile.rkt" json file/gzip @@ -9,6 +7,7 @@ racket/port racket/match racket/pretty + racket/cmdline web-server/servlet-env web-server/servlet "../make/make-structs.rkt" @@ -103,9 +102,16 @@ +(define current-port (make-parameter 8080)) +(void (command-line + #:once-each + [("-p" "--port") p "Port (default 8080)" + (current-port (string->number p))])) + + (write-repl-runtime-files) (serve/servlet start #:servlet-path "/compile" #:extra-files-paths (list htdocs) #:launch-browser? #f - #:port 8080) \ No newline at end of file + #:port (current-port)) \ No newline at end of file