The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Plugin::MountPSGI - Mount PSGI apps

SYNOPSIS

  # Mojolicious
  $self->plugin('MountPSGI', { '/', => 'ext/MyApp/app.psgi'});

  # Mojolicious::Lite
  plugin 'MountPSGI', { '/', => 'ext/MyApp/app.psgi' };

DESCRIPTION

Mojolicious::Plugin::MountPSGI lets you mount any PSGI app inside a Mojolicious app. For instance you could use this to deploy your PSGI app under hypnotoad, or to include a PSGI app inside a path inside your Mojo app.

The key given is the route under which to mount the app. The value is either a PSGI application or a string which resolves to an instance via "load_psgi" in Plack::Util.

METHODS

Mojolicious::Plugin::MountPSGI inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

  $plugin->register;

Register plugin in Mojolicious application.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us.

COPYRIGHT

Most of this module was assembled from the Mojo mount plugin and the Mojolicious-Plugin-PlackMiddleware plugin. Copyright on that code belongs to the authors.

The remainder is (C) 2011-2015 Marcus Ramberg

LICENSE

Licensed under the same terms as Perl itself.