Commit 938d0ec1 authored by Luc Didry's avatar Luc Didry

Use Config plugin

Now, you can config LSTU with the Lstu.conf file
parent 83c2e11f
......@@ -21,7 +21,9 @@ use Mojolicious::Lite;
use Mojolicious::Plugin::DefaultHelpers;
use Data::Validate::URI qw(is_uri);
app->secret('fjdhsuqfbndqsufybh');
my $config = plugin 'Config';
app->secret($config->{secret});
get '/' => 'index';
......@@ -77,7 +79,7 @@ my $add = sub {
$short = $records[0]->short;
} else {
do {
$short= $shortener->(8);
$short= $shortener->($c->config->{length});
} while (Model::Lstu->count('where short = ?', $short));
Model::Lstu->new(
url => $url,
......
{
hypnotoad => [
listen => ['http://127.0.0.1:8080']
],
secret => 'fdjsofjoihrei',
length => 8
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment