Snippet: Webrick Serve with Path

index > programming > language > ruby

e.g. This wiki is served with the following:

require 'webrick'

server = WEBrick::HTTPServer.new(Port: 8000)
server.mount(
  '/wiki-base',
  WEBrick::HTTPServlet::FileHandler,
  './docs'
)
server.start