Hello,

MP does not by default include a routing engine like Dancer or Mojo or
other frameworks.

There are routing engines available (but I'm not very familair with them).

For a pure MP option, see this example from something I've done:

$base_uri = "/app/"
uri = /app/type/AAAA/domain/dns-api.org/



   my $uri = $r->uri();
>                 # Remove the base uri from the uri
>                 $uri =~ s/^$base_uri//g;
>                 # Split the components out by '/'
>                 my @components = split(/\//, $uri);
>          # Take all the components and make the odd ones the names and the
> even ones
>          # the values in the CGI query object
>                 while (@components)
>                         {
>                         $components[1] =~ s/\|/\//g;
>                         $q->param(-name => shift(@components), -value =>
> shift(@components));
>                         }
>                 }



*Lathan Bidwell*

Web Programmer
Division of Integrated Marketing & Communication
Andrews University

269-471-6313
*office*www.andrews.edu

"Seek Knowledge.  Affirm Faith.  Change the World."



On Mon, Aug 7, 2017 at 7:18 AM, 风河 <m...@fenghe.org> wrote:

> Hi,
>
> for this like request:
> curl http://dns-api.org/AAAA/dns-api.org
>
> in Dancer we could write:
>
> get '/:type/:domain/?' => sub {
>
>     my $rtype  = params->{ 'type' };
>     my $domain = params->{ 'domain' };
>
>
> But in a MP handler, how could we get the similiar result, treating
> request path as GET/POST arguments?
>
> thanks.
>

Reply via email to