pgc-www/script/my_app

24 lines
773 B
Perl
Executable File

#!/usr/bin/env perl
#
# A note about lighttpd and fastcgi, based on
# <https://github.com/mojolicious/mojo/wiki/Deploying-on-Lighttpd-with-FastCGI>
# which shows how to start the app via lighttpd. However, it doesn't
# show how to start the app yourself, outside of lighttpd, in such
# a way that it'll work under fcgi.
#
# To do this:
# Change the lighttpd conf to remove "bin-path" and instead use (e.g.)
# "host" => "localhost".
# Then to start the app, use 'spawn-fcgi', e.g.
# spawn-fcgi -a 127.0.0.1 -p 8080 -- script/my_app fastcgi
use strict;
use warnings;
use Mojo::File qw(curfile);
use lib curfile->dirname->sibling('lib')->to_string;
use Mojolicious::Commands;
# Start command line interface for application
Mojolicious::Commands->start_app('MyApp');