if there is no config file, use defaults instead of throwing an error

svn: r1807
This commit is contained in:
Eli Barzilay 2006-01-11 21:47:52 +00:00
parent 1d0d583739
commit 26531d4405

View File

@ -45,12 +45,11 @@
(define server-dir (current-directory))
(define config-file (build-path server-dir "config.ss"))
(unless (file-exists? config-file)
(error 'handin-server
"must be started from a properly configured directory"))
(define (get-config which default)
(get-preference which (lambda () default) #f config-file))
(if (file-exists? config-file)
(get-preference which (lambda () default) #f config-file)
default))
(define PORT-NUMBER (get-config 'port-number 7979))
(define HTTPS-PORT-NUMBER (get-config 'https-port-number (add1 PORT-NUMBER)))