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]> |
Hi, My apologies for such a basic question, but for some reason I'm having trouble wrapping my head around the notations. I have CSS and JavaScript files in css and js off the project directory. I want to serve them. I feel like this should work: :- http_handler(css(.), http_reply_from_files(css, []), [prefix]). :- http_handler(js(.), http_reply_from_files(js, []), [prefix]). Yet, when I run this I get no browsing on /css or /js, and when I try to hit files that definitely exist, I get (for instance) source_sink `css(bootstrap.css)' does not exist. The containing folder fails with: goal unexpectedly failed: http_server_files:serve_files_in_directory(css,[protocol(http),peer(ip(127,0,0,1)),pool(client(httpd@8001,user:http_dispatch,<stream>(0x7fdc39d330f0),<stream>(0x7fdc39d33690))),input(<stream>(0x7fdc39d330f0)),method(get),request_uri(/css/),path(/css/),http_version(1-1),host(localhost),port(8001),accept([media(text/html,[],1.0,[]),media(application/xhtml+xml,[],1.0,[]),media(application/xml,[],0.9,[]),media(_G2560/_G2561,[],0.8,[])]),accept_language(en-us),connection(keep-alive),accept_encoding(gzip, deflate),user_agent(Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11)]) Any advice? I'm sure I'm doing something stupid. Thanks, — Daniel Lyons