minecreft 629 Bytes
#!/usr/bin/env perl
use Mojolicious::Lite;

# Documentation browser under "/perldoc"
plugin 'PODRenderer';


get '/' => sub {
	my $self = shift;
	$self->render('index');
};

get '/download' => sub {
	my $self = shift;

	my @files = <public/data/*.zip>;

	my $data = [];

	foreach my $file (@files) {
		my ( undef, $path, $file ) = split (/\//, $file);
		push $data, $path . "/" . $file;
	} 

	$self->render(
		template 	=> 'download',
		layout 		=> 'default',
		folders		=> $data,
	);
};

get '/admin' => sub {
	my $self = shift;

	$self->render(
		template 	=> 'admin/files',
		layout 		=> 'admin',
	);
};

app->start;
__DATA__