ASP4x-Router
view release on metacpan or search on metacpan
- $r->pnotes(route) is set even if we don't do routing. This makes routing more consistent.
2010-04-06 v0.012
- Handlers are now also covered by the "don't-route-if-the-file-actually-exists"
logic from v0.010-v0.011.
- Added tests to verify the new behavior.
2010-04-06 v0.011
- Finished the whole "don't-route-if-the-file-actually-exists" thing that was
started in v0.010
- Requires ASP4 v1.025 because of a change in the way that $Config->web->router
is setup (now it actually happens inside of ASP4::ConfigNode::Web.
2010-04-05 v0.010
- If /foo/bar.asp is a real file on disk then route-matching will be skipped.
2010-04-05 v0.009
- Sometimes get_router() was returning strange values - added a workaround to
prevent this.
2010-04-01 v0.008
lib/ASP4x/Router.pm view on Meta::CPAN
the actual layout of files on disk.
=head2 How does it work?
C<ASP4x::Router> uses L<Router::Generic> for the heavy lifting. It functions as
both a mod_perl C<PerlTransHandler> and as a L<ASP4::RequestFilter>, providing the
same exact routing behavior for both L<ASP4::API> calls and for normal HTTP requests
handled by the mod_perl interface of your web server.
When a request comes in to Apache, mod_perl will know that C<ASP4x::Router> might
make a change to the URI - so it has C<ASP4x::Router> take a look at the request. If
any changes are made (eg - C</foo/bar/1/> gets changed to C</pages/baz.asp?id=1>)
then the server handles the request just as though C</pages/baz.asp?id=1> had been
requested in the first place.
For testing - if you run this:
$api->ua->get('/foo/bar/1/');
C<ASP4x::Router> will "reroute" that request to C</pages/baz.asp?id=1> as though you
had done it yourself like this:
( run in 0.690 second using v1.01-cache-2.11-cpan-0c5ce583b80 )