but it fails every time.

How does it fail?

How can I make the route call itself?

I think you did

$ lwp-request -UuSsEe "http://localhost/add_news?offset=2" GET http://localhost/add_news?offset=2 User-Agent: lwp-request/6.03 libwww-perl/6.05 302 Found Connection: keep-alive Date: Wed, 19 Jun 2013 04:13:40 GMT Location: http://localhost/add_news?offset=12 Server: Mojolicious (Perl) Content-Length: 0 Client-Date: Wed, 19 Jun 2013 04:13:40 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 GET http://localhost/add_news?offset=12 User-Agent: lwp-request/6.03 libwww-perl/6.05 200 OK Connection: keep-alive Date: Wed, 19 Jun 2013 04:13:40 GMT Server: Mojolicious (Perl) Content-Length: 12 Content-Type: text/html;charset=UTF-8 Client-Date: Wed, 19 Jun 2013 04:13:40 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 offset = 12 $ lwp-request -UuSsEe "http://localhost/add_news?offset=3000" GET http://localhost/add_news?offset=3000 User-Agent: lwp-request/6.03 libwww-perl/6.05 200 OK Connection: keep-alive Date: Wed, 19 Jun 2013 04:13:50 GMT Server: Mojolicious (Perl) Content-Length: 14 Content-Type: text/html;charset=UTF-8 Client-Date: Wed, 19 Jun 2013 04:13:50 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 offset = 3000
[Tue Jun 18 21:13:39 2013] [info] Listening at "http://localhost:80/". Server available at http://localhost:80/. [Tue Jun 18 21:13:40 2013] [debug] Your secret passphrase needs to be +changed!!! [Tue Jun 18 21:13:40 2013] [debug] GET "/add_news". [Tue Jun 18 21:13:40 2013] [debug] Routing to a callback. [Tue Jun 18 21:13:40 2013] [debug] 302 Found (0.001987s, 503.271/s). [Tue Jun 18 21:13:40 2013] [debug] GET "/add_news". [Tue Jun 18 21:13:40 2013] [debug] Routing to a callback. [Tue Jun 18 21:13:40 2013] [debug] 200 OK (0.000847s, 1180.638/s). [Tue Jun 18 21:13:50 2013] [debug] GET "/add_news". [Tue Jun 18 21:13:50 2013] [debug] Routing to a callback. [Tue Jun 18 21:13:50 2013] [debug] 200 OK (0.000711s, 1406.470/s).

In reply to Re: Mojolicious and calling current route by Anonymous Monk
in thread Mojolicious and calling current route by onelander

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.