File: PluginWithEmbeddedApp.pm

package info (click to toggle)
libmojolicious-perl 2.98%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,968 kB
  • sloc: perl: 10,178; sh: 48; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 407 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package PluginWithEmbeddedApp;
use Mojo::Base 'Mojolicious::Plugin';

# "I heard you went off and became a rich doctor.
#  I've performed a few mercy killings."
sub register {
  my ($self, $app) = @_;
  $app->routes->route('/plugin')->detour(PluginWithEmbeddedApp::App::app());
}

package PluginWithEmbeddedApp::App;
use Mojolicious::Lite;

# GET /foo
get '/foo';

1;
__DATA__
@@ foo.html.ep
plugin works!\