Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dancer doesn't give access to psgi.input without reading it all
- Loading branch information
Showing
8 changed files
with
174 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
#!/usr/bin/env perl | ||
use Dancer; | ||
|
||
use strict; | ||
use MogileFS::REST; | ||
dance; | ||
|
||
## get the configuration for this app | ||
my $servers; | ||
if (my $cnf = $ENV{MOGILEFS_REST_SERVERS}) { | ||
$servers = [ split /,/, $cnf ]; | ||
} | ||
my $default_class = $ENV{MOGILEFS_REST_DEFAULT_CLASS} || "normal"; | ||
my $largefile = defined $ENV{MOGILEFS_REST_LARGEFILE} | ||
? $ENV{MOGILEFS_REST_LARGEFILE} | ||
: 1; | ||
|
||
## instantiate a new app | ||
my $app = MogileFS::REST->new( | ||
servers => $servers, | ||
default_class => $default_class, | ||
largefile => $largefile, | ||
); | ||
|
||
## psgi run it | ||
$app->run(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package MogileFS::REST::DumbLogger; | ||
use strict; | ||
|
||
sub new { | ||
return bless {}, shift(); | ||
} | ||
|
||
for my $lvl (qw/debug info warn error fatal/) { | ||
no strict 'refs'; | ||
*{$lvl} = sub { | ||
my $logger = shift; | ||
print STDERR join (" ", uc($lvl), @_), "\n"; | ||
}; | ||
} | ||
|
||
1; |
This file contains 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