diff --git a/lib/Lufi.pm b/lib/Lufi.pm index 8e3c852..5019fe2 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -148,9 +148,9 @@ sub startup { })->name('index'); # Get a file - $r->get('/r/:short') - ->to('Files#r') - ->name('render'); + $r->get('/r/:short')-> + to('Files#r')-> + name('render'); # List of files (use localstorage, so the server know nothing about files $r->get('/files' => sub { @@ -167,20 +167,29 @@ sub startup { to('Files#delete')-> name('delete'); + # Get mail page + $r->get('/m' => sub { + shift->render(template => 'mail'); + })->name('mail'); + + # Submit mail + $r->post('/m')-> + to('Mail#send_mail'); + # About page $r->get('/about' => sub { shift->render(template => 'about'); })->name('about'); # Upload files websocket - $r->websocket('/upload') - ->to('Files#upload') - ->name('upload'); + $r->websocket('/upload')-> + to('Files#upload')-> + name('upload'); # Get files websocket - $r->websocket('/download/:short') - ->to('Files#download') - ->name('download'); + $r->websocket('/download/:short')-> + to('Files#download')-> + name('download'); } 1; diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index 9ce7580..c988a16 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -1,3 +1,4 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: package Lufi::Controller::Files; use Mojo::Base 'Mojolicious::Controller'; use Mojo::JSON qw(encode_json decode_json true false);