Re: serving css/js out of subdirectories w/ http_reply_from_files
Daniel Lyons <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Wouter Beek writes:
> Hi,
>
> Maybe this is superfluous, but when I was using this for the first
> time I did not immediately get that in statement [1] the former
> occurrence of `css` refers to the HTTP location (registered with
> http:location/3), whereas the latter occurrence of `css` refers to the
> file system path with alias `css` (registered with
> user:file_search_path/2).
>
> ~~~{.pl}
> [1] :- http_handler(css(.), serve_files_in_directory(css), [prefix]).
> ~~~
Yes, I had assumed that it would know that I meant the 'css' directory
in the current working directory. For instance, in Anne's
webserver6_2.pl, registration does not seem to be necessary.
https://github.com/Anniepoo/swiplwebtut/blob/master/webserver6_2.pl
But apparently it helps. :)
--
Daniel Lyons