2022-11-09 13:31:58 +01:00
|
|
|
package BurguillosInfo;
|
|
|
|
use Mojo::Base 'Mojolicious', -signatures;
|
|
|
|
|
|
|
|
# This method will run once at server start
|
|
|
|
sub startup ($self) {
|
|
|
|
|
2022-11-09 22:31:41 +01:00
|
|
|
$self->config(hypnotoad => {listen => ['http://localhost:3000']});
|
2022-11-09 13:31:58 +01:00
|
|
|
# Router
|
|
|
|
my $r = $self->routes;
|
|
|
|
|
|
|
|
# Normal route to controller
|
|
|
|
$r->get('/')->to('Page#index');
|
|
|
|
# $r->get('/:post')->to('Page#post');
|
2022-11-10 10:49:53 +01:00
|
|
|
$r->get('/<:category>.rss')->to('Page#category_rss');
|
2022-11-09 13:31:58 +01:00
|
|
|
$r->get('/:category')->to('Page#category');
|
2022-11-13 02:01:24 +01:00
|
|
|
$r->get('/posts/<:slug>-preview.png')->to('Page#get_post_preview');
|
2022-11-09 13:31:58 +01:00
|
|
|
$r->get('/posts/:slug')->to('Page#post');
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|