Questions tagged [mojolicious-lite]

A single-file DSL for the Mojolicious web framework for the Perl language. It is just a tiny wrapper around Mojolicious, so [tag:mojolicious] may be more appropriate for questions not about the DSL itself.

Related Tags:

77 questions
3
votes
2 answers

How to exit a program running under a Morbo or Hypnotoad server

In the programs running under the Morbo (and Hypnotoad) server a call of exit() is silently ignored and effectively works as a return from the callback. An END block fires as usually but a program itself never exits. #!/usr/bin/perl use…
Yuriy Zhilovets
  • 400
  • 2
  • 10
3
votes
0 answers

Set "secure" flag on Mojolicious session

How does one set the secure flag on a Mojolicious session cookie? I'd like to be able to access it locally also on my test environment which does not run on https. I've read the Sessions docs and the app->session one, and tried (in a…
simone
  • 4,667
  • 4
  • 25
  • 47
3
votes
0 answers

Session cookies with Mojolicious on IIS

Initial post I've posted about my issue on the Mojolicious forum but am still looking for a solution. For various reasons I'm trying to get some Mojolicious apps I've written to run on IIS. I have a 7.5 (2k8r2) and 8.5 (2k12r2) server to test…
3
votes
2 answers

Mojolicious - Can't parse JSON in RESTful

It's impossible to parse JSON in Mojolicious for me. I updated Mojolicious and used before following code, but JSON->new is deprecated. my $json = Mojo::JSON->new; my $user_request = $json->decode($c->req->body); my $err = $json->error; from the…
user3606329
  • 2,405
  • 1
  • 16
  • 28
3
votes
2 answers

Mojolicious gives 404 when getting JS and CSS

I'm new to Mojolicious, and I've got various things working, but I've come up against a problem which I've recreated in the following minimal bit of code. The problem is a simple one: I can't get it to load external CSS and JS files. What surprises…
Chris Dennis
  • 995
  • 7
  • 16
3
votes
1 answer

Beginner problems with Mojolicious -> routes

Following example code from http://mojolicio.us/ is currently running under morbo at http://62.113.243.155/ use Mojolicious::Lite; # Simple plain text response get '/' => {text => 'I ♥ Mojolicious!'}; # Route associating "/time" with…
royskatt
  • 1,190
  • 2
  • 15
  • 35
3
votes
2 answers

Mojolicious and Passwd::Unix

I'm trying to return the list of Unix users on this perl script. I'm using the Mojolicious framework with Passwd::Unix. References: Mojolicious (http://metacpan.org/pod/Mojolicious) Passwd::Unix (http://metacpan.org/pod/Passwd::Unix) That's my…
Caio Tarifa
  • 5,973
  • 11
  • 46
  • 73
2
votes
1 answer

How can I auto-reload my Mojolicious website?

What is the best way to get auto-reloading to work when developing my website (my website runs on Mojolicious)? There exists a development server called morbo, and it does update what is served automatically whenever I save changes to a source file,…
mareoraft
  • 3,474
  • 4
  • 26
  • 62
2
votes
2 answers

Why does perl qx hang in Mojolicious::Lite but not in an ordinary program?

(This is cperl 5, version 24, subversion 4 (v5.24.4c) built for x86_64-linux) Ubuntu 18.04. Below is a program that works. However, when I run this program from within Mojolicious::Lite (version 6.04), it hangs. Using top, I see that "tr" is the one…
ftumsh
  • 89
  • 5
2
votes
0 answers

How to change templates folder in perl Mojolicious lite?

I would like to have the following strucutre in my project: folder \_script_1.pl mojolicious_ui_script.pl HTML \_website.html.ep CSS \_website.css.ep But I'm just able to get it to work using this default strucutre: folder \_script_1.pl …
nck
  • 1,673
  • 16
  • 40
2
votes
2 answers

hypnotoad helper function in mojolicious lite

the Mojolicious::Lite app is working with morbo but not working with hypnotoad. my $dbh = DBI->connect("dbi:mysql:dbname=xxx", "uname", "pass", { AutoCommit => 0, mysql_enable_utf8 => 1}, ) or die "Couldn't connect to database: ",…
rx57
  • 189
  • 1
  • 5
2
votes
1 answer

How to declare a route path with an optional placeholder in Mojolicious::Lite?

I need to declare a route that could treat two kinds of requests: GET /api/vote/:value GET /api/vote/:value/:date The way I treat the data is not that different in both cases, so I would like them to be defined in the same place. What I did for…
smonff
  • 3,399
  • 3
  • 36
  • 46
2
votes
1 answer

Mojolicious redirect to different path under 'under' with userinfo

I have two routes One under 'under' which does the authentication from 'userinfo' and another one which is meant for public post '/public' => sub { my $c = shift; my $submitter = $c->param('submitter'); my $password =…
Zarul Zakuan
  • 510
  • 3
  • 13
2
votes
3 answers

websocket asynchronous feedback during a long process

I am trying to implement a feedback in a web page that let the user start a long process from an Excel sheet (sight, yes...). For each line of the data, the processing time is about 1 second, and the common data length is between 40 and 100 items,…
Seki
  • 11,135
  • 7
  • 46
  • 70
2
votes
0 answers

Mojolicious-lite command not found error when trying to run any command line commands

I created my mojolicious-lite app on my own(just created files I needed manually instead of using the "create app" commands). I am following along with the tutorial here:…
Dont9889
  • 133
  • 1
  • 4