Questions tagged [mojolicious]

Mojolicious is an MVC web framework in Perl.

Back in the early days of the web there was this wonderful Perl library called CGI, many people only learned because of it. It was simple enough to get started without knowing much about the language and powerful enough to keep you going, learning by doing was much fun. While most of the techniques used are outdated now, the idea behind it is not. Mojolicious is a new attempt at implementing this idea using state of the art technology.

Features An amazing web framework supporting a simplified single file mode through Mojolicious::Lite. Powerful out of the box with RESTful routes, plugins, Perl-ish templates, session management, signed cookies, testing framework, static file server, I18N, first class unicode support and much more for you to discover.

Features

  • An amazing MVC web framework supporting a simplified single file mode through Mojolicious::Lite. Powerful out of the box with RESTful routes, plugins, Perl-ish templates, session management, signed cookies, testing framework, static file server, I18N, first class unicode support and much more for you to discover.
  • Very clean, portable and Object Oriented pure Perl API without any hidden magic and no requirements besides Perl 5.8.7.

  • Full stack HTTP 1.1 and WebSocket client/server implementation with IPv6, TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart support.

  • Builtin async IO web server supporting epoll, kqueue, UNIX domain sockets and hot deployment, perfect for embedding.

  • Automatic CGI, FastCGI and PSGI detection.

  • JSON and XML/HTML5 parser with CSS3 selector support.

  • Fresh code based upon years of experience developing Catalyst.

Resources and links

672 questions
6
votes
2 answers

How do I most reliably preserve HTML Entities when processing HTML documents with Mojo::DOM?

I'm using Mojo::DOM to identify and print out phrases (meaning strings of text between selected HTML tags) in hundreds of HTML documents that I'm extracting from existing content in the Movable Type content management system. I'm writing those…
Dave Aiello
  • 490
  • 2
  • 16
6
votes
2 answers

Mojolicious session does not expire

I'm building a web application using mojolicious. The logout functionality works only while running the app on local machines. When I try to logout on the app running on the server, the session does not expire and I remain logged in. This started…
Petru
  • 500
  • 6
  • 19
6
votes
1 answer

lighttpd + perl + mojolicious =?

Does mojolicious working under the lighttpd web-server? How to cofigure? Does I need setup the FastCGI? It's my first usage of lighttpd.
VeroLom
  • 3,856
  • 9
  • 34
  • 48
6
votes
1 answer

Sqlite unable to find DB file with Mojolicious and Par Packer

I'm writing a program with Perl that uses Mojolicious and Sqlite. I will be using Par Packer to distribute it as an .exe file for deployment on other Windows machines. I use Strawberry Perl on Windows for the development. I use the following windows…
gpwr
  • 988
  • 1
  • 10
  • 21
6
votes
1 answer

Why websocket connections breaks

After I run client against websocket echo server, it disconnects after about half a minute with WebSocket closed with status 1006 message. Please suggest how to avoid such behavior (browser clients does not seem to be affected) use 5.20.0; use…
mpapec
  • 50,217
  • 8
  • 67
  • 127
6
votes
2 answers

How do I set up SNI support for Mojolicious?

Perl's Mojolicious supports Server Name Identification (SNI), which some web servers use to host several sites with one HTTPS certificate. I'm working on a system that's not set up to use this, and googling a bit doesn't turn up anything that makes…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
6
votes
3 answers

Route to static file in Mojo

I have small app based on mojolicious. And I have index.html in public dir. I want to have route to this file when user asks for '/'. I wrote two solution, but I don't like them. First solution - add simple controller. sub stratup { //... …
KoVadim
  • 707
  • 1
  • 7
  • 22
6
votes
2 answers

How to upload multiple files using Mojolicious?

I'm new to Mojolicious, trying to learn it. I'm trying to upload multiple files using form but only one file is uploaded at a time. Any suggestion? #!perl -w use Mojolicious::Lite; use Mojo::Upload; use v5.14; get '/' => 'page'; post '/' => sub { …
waghso
  • 623
  • 7
  • 23
6
votes
1 answer

Jquery.get behaviour on timeout?

I'm new to web coding and have been playing with JQuery recently. I've noticed some behaviour and wanted to know if it is normal behaviour and the best way to deal with it. I am doing a simple get to my web server, sometimes the server can take a…
6
votes
1 answer

Why separate routing and controller actions in mojolicious?

I am reading the section of Mojolicious::Guides::Growing where it tells you how to grow a Mojolicious::Lite into a "well organized" cpan-uploadable application. First, it tells you to split the M::L app into a launch script and an application…
user1481
  • 849
  • 1
  • 5
  • 15
6
votes
2 answers

How to test for a redirect in Mojolicious?

I want to test a page with a form which, when submitted, will redirect to the resulting page for the submitted item. My Mojolicious controller contains: sub submit_new { my $self = shift; my $new = $self->db->resultset('Item')->new( { …
stevenl
  • 6,736
  • 26
  • 33
6
votes
3 answers

How do I add more than one over method to a mojolicious route?

I have the following code: $r->find('user')->via('post')->over(authenticated => 1); Given that route I can get to the user route passing through the authenticated check that is setup using Mojolicious::Plugin::Authentication. I want add another…
jmcneirney
  • 1,374
  • 8
  • 23
6
votes
1 answer

Why does Mojolicious nest my routes?

My Mojolicious application has some custom authentication mechanism, which I implement in a routing condition called auth_permission: $app->add_condition(auth_permission => sub { return is_user_allowed(...) ? 1 : 0; }); So my routes look…
Stefan Majewsky
  • 5,427
  • 2
  • 28
  • 51
5
votes
1 answer

Introspecting the name of placeholder variables from a Mojolicious controller

I have a Mojolicious controller that fires in response to different URL routes. For example, given the URL path: /v1/users/:someid and a controller that fires: sub handle_request ($self) { my $place_holder_name = $self->route->?????? # how…
user2145475
  • 657
  • 3
  • 11
5
votes
1 answer

How to define a json-lines response in OpenAPI?

Is there a way to describe a json-lines with OpenAPI? Besides the fact that there seems to be no MIME type for it yet, I'm wondering if it's possible to describe such a response. In theory my response could be an array of objects, but I received the…
Skeeve
  • 7,188
  • 2
  • 16
  • 26