[plt-scheme] inverse regexp
maxigas wrote:
> i am writing an application using dispatch (as you suggested
> earlier) which would process all
> URLs, but i want to exclude the htdocs directory to serve static
> files. i understand that
> serve/servlet's #:servlet-regexp key controls which URLs are passed
> to start, but i couldn't find
> out how to write a regexp which excludes "htdocs".
>
> so what i want is to match everything that is NOT #rx"^/
> htdocs/.*" [...]
Hi,
Sorry I'm so late in replying.
The latest version of Dispatch (v1.10) will do what Jay suggested and
call next-dispatcher if no rules are matched. Make sure you have the
latest version, though, because this behaviour changed recently.
I typically write web apps with a single servlet. I use serve/servlet
like this:
(serve/servlet
start
; Pass all requests to the servlet:
#:servlet-path "/"
#:servlet-regexp #rx""
; Configure extra htdocs paths:
#:extra-files-paths ...)
Cheers,
-- Dave