Answer the question
In order to leave comments, you need to log in
Webrick request handler error - how to fix?
Good day.
I am writing a primitive web server in ruby, without rails.
I use standard http-server webrick
Faced such problem.
When accessing a non-existent file by URL, it gives an error that the file was not found (which is logical).
How can I get a custom server response if the file is not found?
Thank you!
Answer the question
In order to leave comments, you need to log in
I would not fence the bike, but I would recommend then to deal with Rack, then it does not matter which server lies below.
habrahabr.ru/post/131429
And so, if you understand the documentation correctly, then you do something like this:
myserver.mount_proc '/some/path', do |*args|
#....
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question