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 $file; if ( $ENV{PAR_TEMP} ) { print $ENV{PAR_TEMP}, "\n"; $file = $ENV{PAR_TEMP} . "/inc/script/test.conf"; } else { $file = 'test.conf'; } my $config = plugin 'Config' => { file => $file }; get '/test'; if(exists $ENV{PAR_TEMP} && $^O eq "MSWin32") { system qw(start http://localhost:3000/test); } app->start; __DATA__ @@ test.html.ep <%=config->{text}%>

<%=config->{text}%>