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
18
votes
2 answers

Apache proxyPassReverse and Websockets

I've been working on a Perl Mojolicious project that uses websockets. I'm wanting to launch it on a shared server running apache and use proxyPass and proxyPassReverse to make the url prettier for my Mojolicious code running with Hypnotoad. I have…
user1439590
  • 321
  • 2
  • 3
  • 8
15
votes
3 answers

How Upload file using Mojolicious?

I have been trying out Mojolicious web framework based on perl. And I have try to develop a full application instead of the Lite. The problem I am facing is that I am trying to upload files to server, but the below code is not working. Please guide…
Kunal Jha
  • 2,102
  • 4
  • 24
  • 34
14
votes
2 answers

Is Mojolicious's "morbo" good for production?

Is Mojolicious' morbo (development web server) good enough for production? Also, is morbo good enough to handle many http requests? Or, must I use Apache's mod_perl for production instead of morbo?
dns
  • 2,753
  • 1
  • 26
  • 33
13
votes
1 answer

How do I fake the client IP address in a unit test for a Mojolicious app?

In my Mojolicious app I need to use the client's IP address ($c->tx->remote_address) for rate limiting of a service. This works well. I am now trying to build a unit test for this feature, but I am having trouble faking the client's IP in my…
simbabque
  • 53,749
  • 8
  • 73
  • 136
13
votes
1 answer

How to call action in some other controller in Mojolicious?

I have an application that uses the Mojolicious framework. I have a table in the database that has a list of error response and additional details associated with it. I have created corresponding Result and Resultset to work with the DB table. There…
Ha Sh
  • 724
  • 5
  • 26
11
votes
1 answer

How do we unit test a Mojolicious controller?

We have created the following simple Mojolicious controller: package SampleApp::Pages; # $Id$ use strict; use warnings; our $VERSION = '0.01'; use Mojo::Base 'Mojolicious::Controller'; sub home { my $self = shift; $self->render(…
purinkle
  • 907
  • 2
  • 10
  • 20
11
votes
2 answers

Mojolicious url_for: absolute path

I'm currently trying to port one of my smaller catalyst apps to Mojolicious (just for the fun of it). Say that we are on a page: http://whatever.com/generate. On that page there is a link to for example "generated" When using catalyst (with TT…
ldx
  • 2,536
  • 2
  • 18
  • 27
11
votes
1 answer

How can I prevent Mojolicious from character-escaping stash data?

I am trying to send HTML to a template in Mojolicious and am finding that the html is getting replaced with safe strings somewhere along the way. $self->stash(portalHeaderHtml => ""); Becomes <html> In the source The template: <%=…
shaneburgess
  • 15,702
  • 15
  • 47
  • 66
10
votes
1 answer

Why can't I stop my Mojo app using systemd?

I can fire up my Mojo app via systemd without any issues, but I can't stop or restart it in the same way. I've poached my config mostly from the Mojo docs at…
oalders
  • 5,239
  • 2
  • 23
  • 34
10
votes
3 answers

Do Mojolicious and Moose play well together?

I'm working on a Mojo app and I'd like to be able to consume some Moose roles to make my life easier. On CPAN I see MojoX::Moose::Controller, which has very simple internals. I don't see much else on using Moose with Mojo. Any potential issues I…
oalders
  • 5,239
  • 2
  • 23
  • 34
10
votes
3 answers

Nonblocking django?

At work I'm not allowed to use perl for web services. Python is allowed however. What I need to do is serve up the results of some very slow c++ binaries. Each exe takes up to 20 seconds to run. In perl I'd just use mojolicious's non blocking event…
tlrrd
  • 322
  • 3
  • 8
10
votes
3 answers

mojolicious referencing a stash variable not always defined

I am still learning mojolicious and MVC frameworks in general so this just might be a problem where I am thinking about this wrong so if I am please suggest a better way to do the following. I have a route /route/:param where param is sometimes…
Justin Belfield
  • 115
  • 1
  • 5
9
votes
1 answer

Setting cookies in mojolicious response

How do i set a cookie in mojolicious response and later read it from the request. I tried different ways but none of them set cookie on the response object. tried these ways $self->res->cookies({name => 'foo', value =>…
PMat
  • 2,039
  • 2
  • 29
  • 46
9
votes
3 answers

Params::Validate or Params::Check, why should I prefer the one or the other?

It is hard for me to choose between two perl modules - Params::Validate and Params::Check. I am writing a Mojolicious application which should be easily distributable. Generally I mean something like uploading a directory structure on a shared…
Беров
  • 1,383
  • 10
  • 22
9
votes
2 answers

Mojo::UserAgent and JavaScript

I wondering if something like the below could be possible to do with Mojo::UserAgent : let's say i have the below code : my $ua = Mojo::UserAgent->new; my $res = $ua->get('mojolicious.org/perldoc')->result; is it possible to intercept…
jsor
  • 637
  • 4
  • 10
1
2 3
44 45