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.
24 This works in with exactly the same code as CGI deployment. However instead of
25 letting your web server load script.cgi, you run this on the command line:
29 =head2 Self-contained CGI
31 Sometimes your app is so small that you have only one or two tiny classes that
32 you want to run as a CGI script. Web::Simple offers a helpful mechanism to
37 use Web::Simple 'HelloWorld'; # enables strictures and warnings for the file
38 # additionally, HelloWorld is upgraded to a
39 # Web::Simple application
43 sub dispatch_request {
47 [ 'Content-type', 'text/plain' ],
48 [ 'Hello world! It is a fine ' . HelloWorld::Helper->day ]
52 [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ]
58 package HelloWorld::Helper;
63 return DateTime->now->day_name;
67 HelloWorld->run_if_script;
71 See L<Web::Simple> for authors.
73 =head1 COPYRIGHT AND LICENSE
75 See L<Web::Simple> for the copyright and license.