from what I understand you set handler() function in a module to do the job.
That is the default, you can change it with the handler_method constructor option. (NOTE: this was broke in any pre-0.03 release)
How do you normally do url-2->method dispatching ?
Usually the web framework I am using will take care of this (Catalyst, CGI::Application, etc). FCGI::Engine is simply about managing FCGI details for you, this kind of stuff is outside of the scope of this module.
and one more thing if I don't specify bin-path config option in lighttpd config then I have to start this handler-script separately with some options (and this is what they call in lighty docs runnging fcgi as external-fcgi-server), right ?
Yes, take a look at FCGI::Engine::Manager for a simple way to do this, the docs are still a little slim but if you look at the "020_basic_manager.t" test file and the contents of t/conf/ and t/scripts/ you will see how it is configured.
| [reply] |
How do you normally do url-2->method dispatching ?
Usually the web framework I am using will take care of this (Catalyst, CGI::Application, etc). FCGI::Engine is simply about managing FCGI details for you, this kind of stuff is outside of the scope of this module.
I meant if I want to do it ;) ? I'll take a look at the frameworks, but !
I would be using it to flush JSON structures and from time to time some html page and rather do it manually than using framework.
| [reply] |
Well, it all depends on what you want to dispatch off of. If you like the REST-ish URLs, then you might want to dispatch from path_info. If you don't care about URLs, then you can just simply pass in another parameter to dispatch on. I would put all this logic inside the ->handler method and have it call other methods.
However, all this said, you really should just use a pre-existing tool, it will save you TONS of time in the long run. If size and learning curve is an issue, then I highly recommend CGI::Application. It is much simpler then Catalyst or Jifty, and will give you all the basic things you will need with very little overhead and few dependencies.
| [reply] |