Webrick:: Access to public folders (css, js etc)

Posted by Nikita Kuhta on Stack Overflow See other posts from Stack Overflow or by Nikita Kuhta
Published on 2012-04-15T18:58:12Z Indexed on 2012/04/16 11:29 UTC
Read the original article Hit count: 159

Filed under:
|

Webrick serves "/" path, but I want to have direct access to css, js and other public folders.

if I use DocumentRoot, will handle all public paths too (like css/style.css), because it hadles root path:

server = WEBrick::HTTPServer.new(
:DocumentRoot => Dir::pwd,
:Port=>8080
)

I need to mount_proc my root:

server.mount_proc('/') {|req,resp|  ......

How to give access to public folders?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about webrick