@@ -31,6 +31,7 @@
call-with-http-server
call-with-http-server*
%http-server-port
+ %local-url*
%local-url))
;;; Commentary:
@@ -64,12 +65,14 @@ actually listened at (in case %http-server-port was 0)."
(strerror err))
(values #f #f)))))
-(define* (%local-url #:optional (port (%http-server-port)))
+(define* (%local-url* resource #:optional (port (%http-server-port)))
+ ;; The URL to the resource named RESOURCE on the current HTTP server.
(when (= port 0)
(error "no web server is running!"))
+ (string-append "http://localhost:" (number->string port) resource))
+(define* (%local-url #:optional (port (%http-server-port)))
;; URL to use for 'home-page' tests.
- (string-append "http://localhost:" (number->string port)
- "/foo/bar"))
+ (%local-url* "/foo/bar" port))
(define* (call-with-http-server* handle thunk #:key (keep-lingering? #false)
(last-response? (const #false)))