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.
25 lines
535 B
25 lines
535 B
10 years ago
|
package Livecam;
|
||
|
use Mojo::Base 'Mojolicious';
|
||
|
|
||
|
sub startup {
|
||
|
my ($self) = @_;
|
||
|
|
||
|
my $r = $self->routes;
|
||
|
|
||
|
$r->get('/')->to(cb => sub {
|
||
|
shift->redirect_to('/playlist')
|
||
|
});
|
||
|
|
||
|
$self->app->attr(ua => sub {
|
||
|
require Mojo::UserAgent;
|
||
|
my $ua = Mojo::UserAgent->new;
|
||
|
$ua->name(qq{Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140925 Firefox/24.0 Iceweasel/24.8.1});
|
||
|
return $ua;
|
||
|
});
|
||
|
|
||
|
$r->route('/playlist') -> via('GET') -> to('main#playlist');
|
||
|
$r->route('/livecam') -> via('GET') -> to('main#livecam');
|
||
|
}
|
||
|
|
||
|
1;
|