---------------------    Launcher script/launcher.pl  -------------------------
#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename 'dirname';
use File::Spec;

use lib join '/', File::Spec->splitdir(dirname(__FILE__)), 'lib';
use lib join '/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib';

# Check if Mojo is installed
eval 'use Mojolicious::Commands';
die <<EOF if $@;
It looks like you don't have the Mojolicious Framework installed.
Please visit http://mojolicio.us for detailed installation instructions.

EOF

# Application
$ENV{MOJO_APP} ||= 'Sinac';

# Start commands
Mojolicious::Commands->start;
--------------------------------------------------------------------

---------------------------  My App lib/Sinac.pm  --------------------------
package Sinac;

use Mojo::Base; 'Mojolicious';
use Try::Tiny;


sub startup {
 my $self = shift;
 
 my $r = $self->routes;
 
 $r->route('/')->name('index')->to('Static#index');
 $r->route('/contact')->name('contact')->to('Static#contact');
 $r->route('/presta')->name('presta')->to('Static#presta');
 $r->route('/presta!appli')->name('presta_appli')->to('Static#presta_appli');
 $r->route('/presta!web')->name('presta_web')->to('Static#presta_web');
 $r->route('/presta!network')->name('presta_network')->to('Static#presta_network');
}

1;
---------------------------------------------------------------------------


-------------------------------  lib/Sinac/Static.pm  ------------------------------
package Sinac::Static;


use Mojo::Base 'Mojolicious::Controller';
use Try::Tiny;

sub index {
 my $self = shift;
# $self->stash('page' => $pages->[0]);
 $self->render();
}

sub contact {
 my $self = shift;
 $self->render();
}

sub presta {
 shift->render();
}

sub presta_appli {
 shift->render();
}

sub presta_web {
 shift->render();
}

sub presta_network {
 shift->render();
}


1;
-----------------------------------------------------------------------------

Add a code snippet to your website: www.paste.org