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

613 questions
7
votes
1 answer

Mojo::UserAgent - Inspect the Content-Encoding header before decoding

I'm attempting use Mojo::UserAgent to verify the gzip compression (Content-Encoding) of an application. Unfortunately, it appears that this UA silently decodes the content and removes the Content-Encoding header afterwords. The following is my…
Miller
  • 34,344
  • 4
  • 33
  • 55
7
votes
1 answer

Mojolicious one liner to service status files with listing directory

I am looking for Mojolicious one liner for serving static files and listing the directory by default I come to this one liner : perl -Mojo -E "a->static->paths(['c:\temp']);a->start" daemon which serving static files on specific directory but its…
dave
  • 205
  • 5
7
votes
1 answer

"Dynamic" routes in Mojolicious

I would like to implement something like "dynamic" routes in my Mojolicious app. I have some pre-defined "static" routes and a DB table with URL aliases: '/alias' -> '/URL'. Now I'm defining routes on-the-fly and it looks like this: before_dispatch…
deadboy
  • 71
  • 2
7
votes
1 answer

What "ladder sub {...}" means in perl?

I'm reading tweetylicious source from github to study Mojolicious framework: However I'm confused by below piece of code ladder sub .... What does it mean in Perl? It looks like not a regular Perl grammar. Btw, I'm with Strawberry Perl 5. # The…
Hao
  • 318
  • 2
  • 8
7
votes
1 answer

How can I take credentials from the command line in a Mojolicious app?

I am developing a Mojolcious standalone application. In the code I am contacting an internal backend where the user should provide some credentials. Currently I am using the credentials inside the code as variables. It looks some something…
smith
  • 3,045
  • 24
  • 51
7
votes
1 answer

How can I use Mojolicious rendering in a standalone Perl script?

I want to render .html.ep templates using Mojolicious rendering engine in a standalone script which sends e-mails and is run from cron: #!/usr/bin/perl use feature ':5.10'; use Mojo::Base -strict; use Mojolicious::Renderer; use Data::Dumper; my…
Victor
  • 117
  • 6
7
votes
2 answers

How to debug server side script for file uploading from client (curl at this example)?

I am trying to write a Perl Mojolicious request from CLI. I want to pass a file as a parameter to this request. Below are the things I have tried so far, but no avail. Below Example is what working fine with me. curl (working): curl -X POST…
7
votes
1 answer

Mojolicious::Lite with Template Toolkit

I'm trying to get Template Toolkit to work as the default renderer in Mojolicious::Lite. What I have: use strict; use warnings; use Mojolicious::Lite; use Mojolicious::Plugin::TtRenderer; plugin tt_renderer => { template_options => { INCLUDE_PATH…
friedo
  • 62,644
  • 16
  • 111
  • 180
6
votes
1 answer

Globals and Threads in Mojolicious for handling different paths

In my Mojolicious perl code I handle a jobs created and watched from a remote client. I keep the jobs in a array of hashes, which is a global variable. It is then used in handlers of PUT '/job/create' and GET '/job/status'. When adding a new job…
Juan Macek
  • 260
  • 1
  • 3
  • 10
6
votes
2 answers

Example for several (fastcgi/uwsgi/scgi/proxy_pass) Mojolicious apps in the same nginx virtual host?

I have some Mojolicious-based apps which happily run under Apache2 with mod_cgi and mod_fastcgi. The urls are for example: http://example.org/oneapp/path/info?foo=bar http://example.org/oneapp?foo=bar …
Беров
  • 1,335
  • 10
  • 22
6
votes
1 answer

Mojolicious - how to intercept the incoming request before controller method handles and renders

In Mojolicious app, I need to figure out which controller method will be handling the incoming request so that I can log details of the remote client and add some logic. I want to do it at only one place and not in every controller methods. I have…
Sachin Dangol
  • 424
  • 3
  • 11
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
  • 332
  • 1
  • 16
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,518
  • 8
  • 32
  • 47
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
  • 819
  • 1
  • 8
  • 18
1 2
3
40 41