package LDV; use strict; use warnings; use utf8; use Mojo::Base 'Mojolicious'; sub startup { my ($self) = @_; $self->plugin(I18N => {default => 'ru'}); $self->plugin(Config => {file => $self->app->home->rel_file('conf/ldv.conf')}); $self->app->mode('production'); $self->app->secret($self->app->config->{secret}); my $r = $self->routes; # /user $r->get('/user/login')->to('user#login'); $r->get('/user/create')->to('user#create'); $r->get('/user/update')->to('user#update'); $r->post('/user/create')->to('actions#create'); # /zerobin my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin'); $zb->post('/') -> to(action => 'save'); $zb->get('/') -> to(action => 'create'); $zb->get('/:id', id => qr/[0-9a-f]{8}/) -> to(action => 'view'); } 1;