sunet/scheme/httpd/surflets/load-surflet-server.scm

38 lines
1.1 KiB
Scheme

; reads package description in the right order
; in the end, the server can be started via (server)
(batch 'on)
(define *ASSUMED-SUNET-HOME*
(in 'scsh '(run (match:substring
(regexp-search (rx (submatch (* any) "sunet")) (cwd))
1))))
(define *SUNET-PACKAGE*
(in 'scsh `(run (string-append
(or (getenv "SUNETHOME")
,*ASSUMED-SUNET-HOME*)
"/packages.scm"))))
(define *SSAX-PACKAGE*
(in 'scsh `(run (string-append
(or (getenv "SSAXPATH")
(string-append ,*ASSUMED-SUNET-HOME* "/SSAX"))
"/lib/packages.scm"))))
(define *SERLVET-PACKAGE*
(in 'scsh `(run (string-append
(or (getenv "SUNETHOME")
,*ASSUMED-SUNET-HOME*)
"/httpd/servlets/packages.scm"))))
(define *SERVLET-SERVER*
(in 'scsh `(run (string-append
(or (getenv "SUNETHOME")
,*ASSUMED-SUNET-HOME*)
"/httpd/servlets/start-servlet-server"))))
(config `(load ,*SUNET-PACKAGE*))
(config `(load ,*SSAX-PACKAGE*))
(config `(load ,*SERLVET-PACKAGE*))
(config `(load ,*SERVLET-SERVER*))
(user)
(open 'servlet-server)
(batch 'off)
(in 'scsh '(run (display "type (server) to start the server\n")))