in any rails new project , there exist config.ru which containns Rack configs for Rack base servers, and here is it's official website http://rack.github.io/
the Question is: what is it's exact use in Ruby?
Rack is what's called Middleware. It's a layer that sits between your rails app and the webserver. So instead of Rails having to know how to talk to HTTP, it just has to know how to talk to Rack. Rack handles all of the HTTP information coming in & out. And formats the request object, the response object and such with all the header information and details that you use in your app.
Just to add, the config.ru file is essentially the file rack executes when it starts up. You can start your own rack application by running:
rackup config.ru
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With