[Nitro] New Nitro dispatcher proposal

George Moschovitis george.moschovitis at gmail.com
Mon Jan 22 04:38:51 EST 2007


Dear devs,

as promised I will describe my thoughts on the revised way of handling the
request uris that I would like to include in Nitro.

At the moment the request uri handling in Nitro is quite simple (but
surprisingly effective):


If the uri containts a '.' (in other words if there is a file extension)
  -> the request is handled by the front web server.
If the uri has no extension,
  -> append the .html extension and check if the file exists
     - yes? -> the request is handled by the front web server.
     - no? -> the request is handled by Nitro


I propose the following change:

If the uri contains no extension automatically add the .html extension
Does the file pointed to by the uri exist?
  - yes ? -> the request is handled by the front web server
  - no? -> the request is handled by Nitro (append x at the end of the
extension)

For example:

if request.uri == index, Nitro searches for

  index -> index.html
  index.html (front)
  index.htmlx / index action (nitro)
  content_type = text/html

if request.uri == screen.css, Nitro searches for

  screen.css (front)
  screen.cssx / screen__css action (nitro)
  content_type = text/css


I would love to hear your thoughts on this new scheme.


best regards,
George.





-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070122/be31ebf3/attachment.html 


More information about the Nitro-general mailing list