This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use MooseX::Declare; | |
our $VERSION = '0.02'; | |
# XXX: fuck, please, refactoring me :) | |
class Geo::Message { | |
has 'data' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); | |
method parse(Str $data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/' => 'index'; | |
get '/ok' => 'index_ok'; | |
use Test::More; | |
plan tests => 6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/' => 'index_with_block'; | |
shagadelic; | |
__DATA__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/' => sub { | |
my $self = shift; | |
$self->main::mail( | |
to => 'To', | |
from => 'From', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check routes: script/app routes | |
my $r = $self->routes; | |
$r->route("/$_")->to("user-auth#$_") for qw(login signup forgot); | |
# check user | |
for($r->bridge->to('user-auth#check')) { | |
$_->route('/')->to('about#index'); | |
$_->route('/movies')->to('movie#main'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# error | |
proxy_intercept_errors on; | |
proxy_ignore_client_abort on; | |
recursive_error_pages on; | |
error_page 400 403 404 /404.html; | |
error_page 500 502 503 504 512 =200 /500.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use lib qw(../mojo/lib); | |
use Mojolicious::Lite; | |
use utf8; | |
plugin(charset => {charset => 'utf-8'}); | |
get '/author/:name' => sub { | |
my $self = shift; | |
warn $self->stash('name'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $a = $r->route('/api/disk')->to('api-disk#'); | |
$a->route('/')->to('#one'); | |
$a->route('/add')->to('#add'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use common::sense; | |
use lib qw(../lib lib); | |
$ENV{MOJO_APP} ||= 'App'; | |
use Mojolicious::Commands; Mojolicious::Commands->start; | |
package App; | |
use common::sense; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
server => { | |
www => 'http://www.site.ru', | |
media => 'http://media.site.ru', | |
}, | |
log => { | |
level => 'error', # 'debug', | |
path => 'log/site.log', | |
}, | |
cookie => { |