2023-10-25 15:50:22 +02:00
|
|
|
#!/usr/bin/env perl
|
2023-10-25 15:50:33 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2023 Afnic
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#
|
|
|
|
|
2023-10-25 15:50:22 +02:00
|
|
|
BEGIN { $ENV{DANCER_APPHANDLER} = 'PSGI';}
|
|
|
|
use Dancer2;
|
|
|
|
use FindBin '$RealBin';
|
|
|
|
use Plack::Handler::FCGI;
|
|
|
|
|
|
|
|
# For some reason Apache SetEnv directives don't propagate
|
|
|
|
# correctly to the dispatchers, so forcing PSGI and env here
|
|
|
|
# is safer.
|
|
|
|
set apphandler => 'PSGI';
|
|
|
|
set environment => 'production';
|
|
|
|
|
|
|
|
my $psgi = path($RealBin, '..', 'bin', 'app.psgi');
|
|
|
|
my $app = do($psgi);
|
|
|
|
die "Unable to read startup script: $@" if $@;
|
|
|
|
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);
|
|
|
|
|
|
|
|
$server->run($app);
|