It did not run because unit does not set PLACK_ENV; I've set it and now 
fights next problem. But nginx unit, according to tests, is a REALLY cool 
thing.

среда, 23 января 2019 г., 21:44:44 UTC+3 пользователь Stefan Adams написал:
>
> I don't know the first thing about PSGI, but Nginx Unit sounds really 
> interesting!  Thanks for bringing it up!
>
> Try this from the cookbook Plack middleware 
> <https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Plack-middleware>
>  
> and PSGI/Plack 
> <https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack>?
>
> use Mojolicious::Lite;use Plack::Builder;
> get '/welcome' => sub {
>   my $c = shift;
>   $c->render(text => 'Hello Mojo!');};
>
> builder {
>   enable 'Deflater';
>   app->start;};
>
>
> On Wed, Jan 23, 2019 at 9:48 AM Alex Povolotsky <[email protected] 
> <javascript:>> wrote:
>
>> Hello
>>
>> There is an app server, from nginx creators, named unit (
>> https://unit.nginx.org/). It supports Perl via PSGI, but fails with 
>> Mojolicious::Lite app.
>>
>> 2019/01/23 09:41:23.029 [error] 26579#26579 [unit] #4: PSGI: Failed to 
>> run Perl Application:
>> Undefined subroutine &main::1 called.
>>
>> plack run the same app without problem, actually, I've tested a bare 
>> minimum one
>>
>> ===
>> #!/usr/bin/env perl
>> use Mojolicious::Lite;
>> get '/' => sub {
>>     my $c = shift;
>>     $c->render(text=>'hello');
>> };
>>
>> app->start;
>> ===
>>
>> Basic Plack code runs ok.
>>
>> I don't have any idea on tracing that error, maybe someone could help?
>>
>> Alex
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to