3 Web::Simple::Deployment - various deployment options
7 This file documents common deployment methods for Web::Simple. If you feel one
8 is missing, please ask in the IRC channel and we'll work with you to add it.
12 The most basic deployment option is as a CGI script loading and running your
17 use Your::Web::Simple::App;
18 Your::Web::Simple::App->run_if_script;
20 Save that as script.cgi and your web server will handle it correctly.
22 =head2 Self-contained CGI
24 Sometimes your app is so small that you have only one or two tiny classes that
25 you want to run as a CGI script. Web::Simple offers a helpful mechanism to
30 use Web::Simple 'HelloWorld'; # enables strictures and warnings for the file
31 # additionally, HelloWorld is upgraded to a
32 # Web::Simple application
36 sub dispatch_request {
40 [ 'Content-type', 'text/plain' ],
41 [ 'Hello world! It is a fine ' . HelloWorld::Helper->day ]
45 [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ]
51 package HelloWorld::Helper;
56 return DateTime->now->day_name;
60 HelloWorld->run_if_script;
64 See L<Web::Simple> for authors.
66 =head1 COPYRIGHT AND LICENSE
68 See L<Web::Simple> for the copyright and license.