The recommended way to get app root is $self->app->path. It is also recommended, but not required to run your app from the root.
You'll need to hard code the path, if you want to run your app from somewhere else.
Regards,
Stefan
The recommended way to get app root is $self->app->path. It is also recommended, but not required to run your app from the root.
You'll need to hard code the path, if you want to run your app from somewhere else.
package MyApp;use Kelp::Base 'Kelp';BEGIN {my $path = $ENV{PROJECT_ROOT} or croak "PROJECT_ROOT not defined";chdir $path or croak "chdir to PROJECT_ROOT '$path' failed: $!";}
use File::ShareDir;
my $path = File::ShareDir::module_dir('YourApp');
{
Template => {
paths => [
$path . '/views',
],
},
}