Skip to content

Commit

Permalink
mention how to deploy multiple applications together in cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 21, 2014
1 parent b1eff9e commit ff5997a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.84 2014-02-20
4.84 2014-02-21

4.83 2014-02-19
- Improved Mojo::JSON to handle encoding errors more gracefully.
Expand Down
10 changes: 10 additions & 0 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -73,6 +73,16 @@ L<Mojo::IOLoop/"timer">.

app->start;

To combine multiple applications into one and deploy them together, you can
use the plugin L<Mojolicious::Plugin::Mount>.

use Mojolicious::Lite;

plugin Mount => {'test1.example.com' => '/home/sri/myapp1.pl'};
plugin Mount => {'test2.example.com' => '/home/sri/myapp2.pl'};

app->start;

=head2 Morbo

After reading the L<Mojolicious::Lite> tutorial, you should already be
Expand Down
5 changes: 4 additions & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -926,13 +926,16 @@ containing a C<handler> method accepting L<Mojolicious::Controller> objects.
1;

You can also just use L<Mojolicious::Plugin::Mount> to mount whole
self-contained applications under a prefix.
self-contained applications under a domain and/or prefix.

use Mojolicious::Lite;

# Whole application mounted under "/prefix"
plugin Mount => {'/prefix' => '/home/sri/myapp.pl'};

# Mount application with subdomain
plugin Mount => {'test.example.com' => '/home/sri/myapp2.pl'};

# Normal route
get '/' => sub { shift->render(text => 'Hello World!') };

Expand Down

0 comments on commit ff5997a

Please sign in to comment.