app = lambda do |env|
body = File.open(File.dirname(__FILE__)+'/404.html', 'r').read
[404, {'Content-Type' => 'text/html'}, [body]]
end
run app
Save the previous script in a file named config.ru. If you have a page 404.html in the same directory of config.ru and you run:
> rackup -p 3000
You will get the 404.html page by connecting to http://localhost:3000. Please notice the curly braces between body: it is needed by Ruby 1.9. The run app statement run the lambda we just created.

Hello, I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts. Server Racks, Kiosk Manufacturer.
ReplyDelete