You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
935 B

10 years ago
package LDV;
use strict;
use warnings;
use utf8;
use Mojo::Base 'Mojolicious';
sub startup {
my ($self) = @_;
$self->plugin(I18N => {default => 'ru'});
my $config = $self->app->home->rel_file('conf/ldv.conf');
$self->plugin(Config => {file => $config});
10 years ago
$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
10 years ago
my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin');
$zb->post('/') -> to(action => 'save');
$zb->get ('/') -> to(action => 'create');
$zb->route('/:time', time => qr/\d+/)
->via('GET') -> to(action => 'view');
my $root = $self->app->config->{zerobin}->{root};
mkdir $self->app->home->rel_dir($root);
10 years ago
}
1;