minecraft 736 Bytes
#!/usr/bin/env perl
use Mojolicious::Lite;

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


get '/' => sub {
	my $self = shift;
	$self->render(
		template 	=> 'index',
		title 		=> 'Welcome',
		layout 		=> 'default',
	);
};

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',
		title 		=> 'Download',
		layout 		=> 'default',
		folders		=> $data,
	);
};

get '/wiki' => sub {
	my $self = shift;
	$self->render(
		template 	=> 'wiki',
		title 		=> 'Wiki',
		layout 		=> 'default',
	);
};

app->start;
__DATA__