owlcode.tech/lib/BurguillosInfo.pm

19 lines
441 B
Perl
Raw Normal View History

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) {
$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');
$r->get('/:category')->to('Page#category');
$r->get('/posts/:slug')->to('Page#post');
}
1;