I've made a small patch to WebServer.nml to help me develop a small haXe lib. I need better control of URIs to make a Front Controller. With Apache, I would use ForceType or mod_rewrite but I can't get mod_neko to work on my (OS X) dev machine, and I also find nekotools server to be a great tool for development so my lib must work with both.

Anyway, I added a command line parameter '-raw' for "raw URIs" that will change the way the request is handled. With this parameter, the WebServer looks for index.n in the base directory and ignores the rest of the request, but it's still available with get_uri() to your application. You can then dispatch the request as you wish.

Maybe someone will use this...

Hi Alex,

Yes this is something interesting that was in my mind for some time. I took a few minutes to add the -rewrite parameter to WebServer on CVS. When enabled, URL will be searched recursively according to the following rules :

/path/to/file/   => /path/to/file/index.n (not recursive)
                    /path/to/file

/path/to/file    => /path/to/file.n   (not recursive)
                    /path/to/         (lookup subdirectory)

This way, if you have an "index.n" file at the root of your website, all URLs will invoke it unless there is another "index.n" in some subdirectory the override it.

Nicolas

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to