moved internal-port to options.ss

svn: r7173
This commit is contained in:
Eli Barzilay 2007-08-26 05:48:55 +00:00
parent 54cec85b45
commit 592be14b81
3 changed files with 16 additions and 7 deletions

View File

@ -17,7 +17,7 @@
(require (lib "web-server.ss" "web-server")
(lib "web-config-unit.ss" "web-server")
"private/config.ss"
"private/internal-hp.ss"
(only "private/internal-hp.ss" internal-host)
"private/options.ss")
(helpdesk-platform 'external-browser)
@ -27,7 +27,7 @@
(serve/web-config@ config))
(printf "\nStart here: http://~a:~a/servlets/home.ss\n\n"
internal-host internal-port)
internal-host (internal-port))
(printf "Press enter to shutdown.\n")
(read-line)

View File

@ -1,7 +1,8 @@
(module internal-hp mzscheme
(require (lib "dirs.ss" "setup")
(lib "config.ss" "planet"))
(provide internal-port
(lib "config.ss" "planet")
"options.ss")
(provide (rename internal-port* internal-port)
is-internal-host? internal-host
collects-hosts collects-dirs
doc-hosts doc-dirs
@ -12,8 +13,8 @@
;; The general idea is that there's one "virtual" host for
;; every filesystem tree that we need to access.
;; (now we use static.ss/host/yadayda instead of the virtual
; host docX.localhost, but we still need to keep track of
; the file system roots)
;; host docX.localhost, but we still need to keep track of
;; the file system roots)
;; The "get-help-url.ss" library provides a function to
;; convert a path into a suitable URL (i.e., a URL using
;; the right virtual host).
@ -24,7 +25,11 @@
;; URLs.)
(define internal-host "localhost")
(define internal-port 8012)
;; fake an internal-port binding (actually a parameter in options.ss)
(define-syntax internal-port*
(syntax-id-rules ()
[(x . xs) ((internal-port) . xs)]
[x (internal-port)]))
(define (is-internal-host? str)
(member str all-internal-hosts))

View File

@ -15,4 +15,8 @@
;; 'external-browser
))
;; Port for the server to listen on
;; (relevant only for a standalone server)
(define internal-port (make-parameter 8012))
)