Skip to content

Commit

Permalink
Maybe calling it a web application instead of server will reduce conf…
Browse files Browse the repository at this point in the history
…usion
  • Loading branch information
kraih committed Jun 12, 2020
1 parent 1f9680a commit 8ab1ce8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

8.54 2020-06-10
8.54 2020-06-12

8.53 2020-06-09
- Added EXPERIMENTAL extname method to Mojo::File.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ app->start;
To run this example with the built-in development web server just put the code into a file and start it with `morbo`.

$ morbo hello.pl
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

$ curl http://127.0.0.1:3000/
I ♥ Mojolicious!
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ sub _listen {
$self->app->log->info(qq{Listening at "$url"});
$query->pairs([]);
$url->host('127.0.0.1') if $url->host eq '*';
say 'Server available at ', $options->{path} // $url;
say 'Web application available at ', $options->{path} // $url;
}

sub _read {
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Morbo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ should avoid modifying signal handlers in your applications.
To start applications with it you can use the L<morbo> script.
$ morbo ./myapp.pl
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000
For better scalability (epoll, kqueue) and to provide non-blocking name resolution, SOCKS5 as well as TLS support, the
optional modules L<EV> (4.32+), L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and L<IO::Socket::SSL>
Expand Down
14 changes: 7 additions & 7 deletions lib/Mojolicious/Guides/Cookbook.pod
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ usually used during development and in the construction of more advanced web ser
small to mid sized applications.

$ ./script/my_app daemon
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

It is available to every application through the command L<Mojolicious::Command::daemon>, which has many configuration
options and is known to work on every platform Perl works on with its single-process architecture.
Expand All @@ -135,7 +135,7 @@ purposes is built right in, so it just works, but you can specify all listen loc
L<Mojo::Server::Daemon/"listen">.

$ ./script/my_app daemon -l https://[::]:3000
Server available at https://[::]:3000
Web application available at https://[::]:3000

To manage the web server with systemd, you can use a unit configuration file like this.

Expand All @@ -156,15 +156,15 @@ On UNIX platforms you can also add pre-forking to the built-in web server and sw
with L<Mojolicious::Command::prefork>, to take advantage of multiple CPU cores and copy-on-write memory management.

$ ./script/my_app prefork
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

Since all built-in web servers are based on the L<Mojo::IOLoop> event loop, they scale best with non-blocking
operations. But if your application for some reason needs to perform many blocking operations, you can improve
performance by increasing the number of worker processes and decreasing the number of concurrent connections each
worker is allowed to handle (often as low as C<1>).

$ ./script/my_app prefork -m production -w 10 -c 1
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

During startup your application is preloaded in the manager process, which does not run an event loop, so you can use
L<Mojo::IOLoop/"next_tick"> to run code whenever a new worker process has been forked and its event loop gets started.
Expand Down Expand Up @@ -204,7 +204,7 @@ changes, and should therefore only be used during development. To start applicat
script.

$ morbo ./script/my_app
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

=head2 Hypnotoad

Expand Down Expand Up @@ -283,13 +283,13 @@ above, but on modern operating systems that support the C<SO_REUSEPORT> socket o
available that works with all built-in web servers.

$ ./script/my_app prefork -P /tmp/first.pid -l http://*:8080?reuse=1
Server available at http://127.0.0.1:8080
Web application available at http://127.0.0.1:8080

All you have to do, is to start a second web server listening to the same port, and stop the first web server
gracefully afterwards.

$ ./script/my_app prefork -P /tmp/second.pid -l http://*:8080?reuse=1
Server available at http://127.0.0.1:8080
Web application available at http://127.0.0.1:8080
$ kill -s TERM `cat /tmp/first.pid`

Just remember that both web servers need to be started with the C<reuse> parameter.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Growing.pod
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ This will be the foundation for our login manager example application.
The built-in development web server makes working on your application a lot of fun thanks to automatic reloading.

$ morbo ./myapp.pl
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

Just save your changes and they will be automatically in effect the next time you refresh your browser.

Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Tutorial.pod
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Many different L<commands|Mojolicious::Commands/"COMMANDS"> are automatically av
L<PSGI> environments can even be detected and will usually just work without commands.

$ ./myapp.pl daemon
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

$ ./myapp.pl daemon -l http://*:8080
Server available at http://127.0.0.1:8080
Web application available at http://127.0.0.1:8080

$ ./myapp.pl cgi
...CGI output...
Expand All @@ -71,7 +71,7 @@ Your application will automatically reload itself if you start it with the L<mor
don't have to restart the server after every change.

$ morbo ./myapp.pl
Server available at http://127.0.0.1:3000
Web application available at http://127.0.0.1:3000

For more information about how to deploy your application see also L<Mojolicious::Guides::Cookbook/"DEPLOYMENT">.

Expand Down

0 comments on commit 8ab1ce8

Please sign in to comment.