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
1
vote
1 answer

How do I set the cookie expiration for MojoX::Sessions?

Whatever expiration value that I give to expires() or expires_delta(), the cookie expiration is always one hour. How do I change it so that the session and the cookie expiration times match?
1
vote
1 answer

CORS: Always get empty response from Mojolicious::Lite via jQuery.ajax

I'm using jQuery to get some data from a Mojolicious::Lite API I'm building. But I can't receive any data from the API via Ajax. I can get data via curl though. Update: I can get the data via Ajax when on same domain. It's a CORS issue. Here's my…
0
votes
3 answers

Allow CORS with Mojolicious::Plugin::SecureCORS

I am new to Mojolicious and using plugins especially SecureCORS. How can I allow CORS on POST requests? I managed to allow CORS for GET with following lines: use Mojolicious::Lite; app->plugin('SecureCORS'); app->routes->to('cors.origin' =>…
WastedFreeTime
  • 195
  • 2
  • 3
  • 16
0
votes
1 answer

Errors accessing hash in mojolicious

I am having issues accessing my hash in mojolicious. my %managers = ( 'IT' => { 'name' => 'Mike', 'id' => 1, 'num_of_employees' => 15, }, 'Sales' => { 'name' => 'John', 'id' => 33, 'num_of_employees'=> 50, }, ); In perl I…
user3525290
  • 1,557
  • 2
  • 20
  • 47
0
votes
2 answers

In mojolicious, how to protect images from public view

Somebody can help me, please. I have app in mojolicious Lite I wanna block images from all without session login when i type http://m.y.i.p:3000/images/imageX.jpg i wanna show images only with session login. my html code is
Memo R
  • 67
  • 5
0
votes
1 answer

Why Mojolicious apps throw 500

Being very new to Mojolicious I am having trouble with getting my apps to work. I am running everything off of a remote server, but all the tutorials I could find only want to show the localhost way of deploying. As the title indicates I am getting…
CoderLee
  • 3,079
  • 3
  • 25
  • 57
0
votes
2 answers

Pass value from one router to another using Mojolicious::Lite

from an ajax form this router foundname gets called, I need to process the value and pass it to another router, I can't figured it out how to do it, here is a sample of how I am trying: #!/usr/bin/perl use Mojolicious::Lite; get '/foundname' =>…
Maresia
  • 67
  • 2
  • 2
  • 6
0
votes
1 answer

WWW::Mechanize::PhantomJS code in Mojolicious Lite script doesn't work when running in background mode

I have this very simple Mojolicious Lite script: #!/usr/bin/env perl use v5.10; use WWW::Mechanize::PhantomJS; use Mojolicious::Lite; my $mech = WWW::Mechanize::PhantomJS->new(); $mech->get('http://stackoverflow.com/'); get '/test' => sub { …
flamey
  • 2,311
  • 4
  • 33
  • 40
0
votes
1 answer

Mojolicious + MongoDB: Can't locate MongoDB.pm error

My app crashes each time it includes as much as "use MongoDB;" in my perl app file. I have installed MongoDB successfully. I can check my databases use one or the other, check for collections, create new collections, all from the shell. If I try to…
Al Ex Tsm
  • 2,042
  • 2
  • 29
  • 47
0
votes
1 answer

Mojolicious sharing of form element name between Perl and the template

I'm new at using Mojolicious and therefore I apologize if this is a basic question but I looked around and couldn't find a good way to do it. I would like to know what's the best strategy to share the name of form parameters between the Perl code…
Jerome Provensal
  • 931
  • 11
  • 22
0
votes
1 answer

Run Hypnotoad HTTP server to serve up XHTML page

I was having a bit of a problem serving up a dot xhtml page using hypnotoad. the xhtml file starts off like this so perhaps I am not declaring something that would allow hypnotoad to display it as something other than text when I head over to…
Nicholai
  • 3
  • 1
0
votes
1 answer

Mojolicious Lite file upload

I can't figure out how to upload files to the remote server in Mojolicious Lite. Here's some code, first, html form:
0
votes
1 answer

How can I add HTML elements to stash mixed with text?

I'm adding a string with HTML
within it to the stash. This stash value is then used to populate a text area. The problem is the browser converts the > and < to lt; and gt; and it displays wrong in the browser. Is there a way to stop this from…
user1768233
  • 1,409
  • 3
  • 20
  • 28
0
votes
1 answer

Getting folder application runs from in Mojolicious Lite

I want to be able to run my Mojolicious Lite app on shared hosting either from root (www.domain.com/) or subfolder (www.domain.com/misc/mymojoapp/). The app's .pl file always goes to cgi-bin folder of the domain (www.domain.com/cgi-bin/myapp.pl) and…
flamey
  • 2,311
  • 4
  • 33
  • 40
0
votes
1 answer

mojolicious - barewords - mojocast 2

Following along with mojocasts episode 2 to learn mojolicious. I have got the example in #!/usr/bin/env perl use Mojolicious::Lite; get '/:fname/:lname' => sub { shift->render('hello'); }; app->start; __DATA__ @@ hello.html.ep
sayth
  • 6,696
  • 12
  • 58
  • 100