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
package Mojolicious::Plugin::Dbic; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use DBIx::Class; | |
use DBIx::Class::Schema::Loader; | |
DBIx::Class::Schema::Loader->naming('v7'); | |
use constant DEBUG => $ENV{MOJO_CONFIG_DEBUG} || 0; | |
my $schemas = {}; |
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 DateTime; | |
use Mojolicious::Lite; | |
get '/' => 'index'; | |
get '/service/datetime' => sub { | |
my $self = shift; | |
my $dt = DateTime->now; |
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 '../mojo/lib'; | |
BEGIN { $ENV{MOJO_TMPDIR} = 'tmp/upload' }; | |
use Mojolicious::Lite; | |
use Data::Dumper; | |
get '/' => 'form'; | |
post '/' => sub { |
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
package MojoX::JSON; | |
use Mojo::JSON; | |
our $SINGLETON; | |
BEGIN { | |
# install JSON::XS if you can! | |
eval 'use JSON();'; | |
eval ( $@ ? 'sub HAS_JSON(){ 0 }' : 'sub HAS_JSON(){ 1 }' ); |
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 strict; | |
use warnings; | |
use Data::Dumper; | |
use Data::UUID; | |
use DBI; | |
use Time::Piece; | |
use Mojolicious::Lite; |
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 strict; | |
use warnings; | |
use Data::Dumper; | |
use Data::UUID; | |
use DBI; | |
use Time::Piece; | |
use Mojolicious::Lite; |
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; | |
my $use_auth = 1; # with auth enabled.. | |
my ( $user, $pass ) = qw/user password/; | |
if ($use_auth) { plugin 'basic_auth'; } | |
get '/' => sub { my $self = shift; $self->redirect_to('/upload'); }; | |
get '/upload' => sub { | |
my $self = shift; |
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'; | |
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 lib 'lib'; | |
package Mojolicious::Plugin::IncludeHelpers; | |
use strict; | |
use warnings; | |
use base 'Mojolicious::Plugin'; | |
use Data::Dumper; |
OlderNewer