Hello World! Application with Mojolicious

The Hello World application (hello.pl) by Mojolicious writes: We will use a module called Mojolicious::Lite included in Mojolicious. It's just three lines, but it's a complete web application.

use Mojolicious::Lite;
get'/' => sub {shift->render(text =>'Hello World!')};
app->start;

Let's run the application on an embedded web server. Run the morbo command on the command line.

morbo hello.pl

The web application is launched with the port number 3000.

Server available at http://127.0.0.1:3000.

Access the following URL on your browser.

http://127.0.0.1:3000/

"Hello World!" Is displayed on the screen.

Associated Information