unit, PSGI and Mojolicous

Александр Поволоцкий tarkhil at over.ru
Wed Jan 23 19:27:39 UTC 2019


On 23.01.2019 19:27, Valentin V. Bartenev wrote:
> On Wednesday 23 January 2019 18:56:57 Александр Поволоцкий wrote:
>> Hello
>>
>> I'm using Mojolicious::Lite, a Perl framework, which should support PSGI.
>>
>> The smallest possible app, however, does not run
>>
>> ===
>> #!/usr/bin/env perl
>> use Mojolicious::Lite;
>> get '/' => sub {
>>       my $c = shift;
>> $c->render(text=>'hello');
>> };
>>
>> app->start;
>> ===
>>
>> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to
>> run Perl Application:
>> Undefined subroutine &main::1 called.
>>
>> plackup runs it Ok, so there is some incompatibility, which I do not
>> know how to trace.
>>
>> What kind of error in framework can it be and how to trace it?
>>
> [..]
>
> https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack
>
> Seems it doesn't behave like PSGI application by default,
> unless there's a PLACK_ENV environment variable.
>
> Unit doesn't set PLACK_ENV by default.

Thanks, it was not clear for me.

Now it starts, but curl just hangs, with nothing in logs. Attempt to use 
external type and plackup results in starting plackup but unit not 
responding. I'll enable debug and try to understand...

Alex



More information about the unit mailing list