Sounds great. I could have used that a few days ago. Haha.
I'm about ready to clean things up in KelpX::AppBuilder and add some proper POD. I'd like to try and work something out for the config first, so there's no need to copy the base app config across. Also, the assets thing is bugging me. With Plack::Middleware::Static, it says you can just define the root twice, but doesn't seem to work with Kelp, so will need to find a way around it.
I've just added the ability to auto-create an 'auto' method in the Root controller. This is handy for things like ensuring a user is logged in before accessing a page. The auto function should get called before every thing else (just like Catalyst). To do this, just add 'auto' => 1 in your maps definition.
sub maps{
{
auto => 1,
'/' => BaseApp::Controller::Root->can('index'),
# etc, etc
}
}
Then in your BaseApp::Controller::Root you can add your logic
sub auto {
my ($self) = @_;
my $url = $self->named->{page};
unless ($url eq 'login') {
if (my $user = $self->user) {
return 1;
}
return;
}
return 1;
}