2021-01-21 00:15:31 -05:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use Mojolicious::Lite;
|
|
|
|
|
|
|
|
get '/' => sub {
|
2021-01-22 20:03:15 -05:00
|
|
|
my ($c) = @_;
|
|
|
|
my $hostHeader = $c->req->headers->host();
|
2021-01-23 19:23:22 -05:00
|
|
|
my $scheme = $c->req->url->base->scheme();
|
2021-01-21 00:15:31 -05:00
|
|
|
|
2021-01-22 20:03:15 -05:00
|
|
|
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
|
|
|
|
$c->render()
|
|
|
|
}
|
|
|
|
else {
|
2021-01-23 19:23:22 -05:00
|
|
|
$c->redirect_to("$scheme://www.wethepeople.win")
|
2021-01-22 20:03:15 -05:00
|
|
|
}
|
2021-01-21 00:15:31 -05:00
|
|
|
} => 'index';
|
|
|
|
|
|
|
|
app->start();
|