Setting default values for stash

Use the defaults method of the Mojolicious class to set default values for stash.

$app->defaults({foo =>'bar'});

This is an example of use with Mojolicious::Lite and Mojolicious.

#Mojolicious::Lite
app->defaults({foo =>'bar'});

#Mojolicious
sub starup {
   my $self = shift;
   $self->defaults({foo =>'bar'});
}

Associated Information