use Mojolicious::Lite; use File::Spec; BEGIN { if(exists $ENV{PAR_TEMP}) { my $dir = File::Spec->catfile($ENV{PAR_TEMP}, 'inc'); chdir $dir or die "chdir `$dir' failed: $!"; push @ARGV, qw( daemon -m production -l http://127.0.0.1:3000 ); } } my $config = plugin 'Config' =>{file => './test.conf'}; get '/test'; if(exists $ENV{PAR_TEMP} && $^O eq "MSWin32") { system qw(start http://localhost:3000); } app->start; __DATA__ @@ test.html.ep