How to run Mojolicious appication under '/api' path( How to ignore some prefix in path )?
<p>I have application it works fine. But now we decide to move it under <code>/api</code> path. So I use <a href="http://mojolicious.org/perldoc/Mojolicious/Routes/Route#detour" rel="nofollow noreferrer">detour</a></p>

<pre><code>my $r = $self-&gt;routes;

# Application is always under /api/v1, /api/v2 etc. path
$r =  $r-&gt;any( '/api/:api', [ api =&gt; qr/v\d+/ ] )-&gt;detour( 'MyApp' );

$r-&gt;get( '/users/me' )-&gt;to( 'user#show_me' );
</code></pre>

<p>But after this nothing works. Request to <code>site.domain/api/v1</code> cause application to fall into endless loop.</p>

<p>There is also <a href="http://mojolicious.org/perldoc/Mojolicious/Plugin/Mount" rel="nofollow noreferrer">Mojolicious::Plugin::Mount</a> but it only useful to <a href="http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Application-embedding" rel="nofollow noreferrer">mount another one application</a> under specified route.</p>

<p><a href="http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Mount-applications" rel="nofollow noreferrer">This</a> guide also does not resolve problem.</p>