Ruby Frameworks - request entry point

I study ruby ​​and look at its framework. One thing I cannot understand is how frameworks handle requests in the ruby ​​world. Digging deeper, I discovered that there is middleware called Rack that does the job.

So my questions are:

  • How does Rack handle an HTTP request?
  • Based on PHP, where is the well-known index.php file as an entry point, what is the reason for the ruby ​​world?

Thanks in advance.

+3
source share
1 answer

From the rack specification:

A Rack application is a Ruby object (not a class) that answers a call. It takes exactly one argument, the environment, and returns an array of three values: status, headers, and body.

pratice config.ru. rails, . config/environment.rb, config/application.rb, boot.rb, . .

, , . index.php.

config.ru( ) . Phusion Passenger, apache nginx, config.ru , .

. Ruby apache/nginx, -, , CGI.

-

+4

Source: https://habr.com/ru/post/1794749/


All Articles