Closed pavelsr closed 4 years ago
Ah, yes, there should be an example there. Also, it could see if it got a string and make the right route for you. But, here's how it works:
sub startup( $app ) {
my $route = $app->routes->any( '/admin' );
$app->plugin( Yancy => {
...
editor => {
route => $route,
},
} );
}
So it's not possible using the standalone yancy
command just yet.
Ok, got it. So for now it's impossible to customize URL just by string in config, need to redefine it in startup.
Hi Doug,
Could you please provide an example of usage route config param?
My purpose is to customize URL - set
/admin
instead of/yancy
.I don't understand how it's possible to do with config - seems like Yancy::Plugin::Editor code expect Mojolicious::Routes::Route object, not a string.
If I set
route => 'admin'
orroute => '/admin'
I getCan't locate object method "to" via package ".admin"
errorSetting
app->routes->any( '/admin' )->name('admin');
gives same error.