Mojolicious
0
Quick Install:
1
|
curl –L https://cpanmin.us | perl – -M https://cpan.metacpan.org -n Mojolicious
|
Parent Link: http://mojolicio.us/ Gererating a Lite App called hello_world:
1
|
mojo generate lite_app hello_world
|
Place holders:
1
2
3
|
/:foo – Generic place holder
/(.foo) – Relaxed place holder which accepts dots
/*foo – Wildcard place holder which accepts dots and forward slashes
|
Using the above 3 you could drive with 2 more place holders.
1
2
|
optional place holder – specifying a default value makes a place holder optional.
restrictive place holder – Specifying a set of values makes the place holder restricted.
|
Using CPAN to install Mojolicious Plugins:
1
|
curl –L cpanmin.us | perl – App::cpanmius
|
Once the cpanminus tools are installed, you could use cpanm to download and install plugins.
1
|
cpanm Mojolicious::Plugin::ParmsAuth
|
Storing Values:
1
2
3
|
stash – works only with current request
flash – works only with the next (future) request
session – works with all request until deleted or expired
|
Debugging Mojo code:
1
|
MOJO_USERAGENT_DEBUG=1 perl mojo_script_name.pl
|
Finding …