21 lines
567 B
Perl
21 lines
567 B
Perl
package BurguillosInfo;
|
|
use Mojo::Base 'Mojolicious', -signatures;
|
|
|
|
# This method will run once at server start
|
|
sub startup ($self) {
|
|
|
|
$self->config(hypnotoad => {listen => ['http://localhost:3000']});
|
|
# Router
|
|
my $r = $self->routes;
|
|
|
|
# Normal route to controller
|
|
$r->get('/')->to('Page#index');
|
|
# $r->get('/:post')->to('Page#post');
|
|
$r->get('/<:category>.rss')->to('Page#category_rss');
|
|
$r->get('/:category')->to('Page#category');
|
|
$r->get('/posts/<:slug>-preview.png')->to('Page#get_post_preview');
|
|
$r->get('/posts/:slug')->to('Page#post');
|
|
}
|
|
|
|
1;
|