add hello-world.cgi example as file
[catagits/Web-Simple.git] / examples / hello-world / hello-world.cgi
1 #!/usr/bin/perl
2
3 use Web::Simple 'HelloWorld';
4
5 {
6   package HelloWorld;
7
8   dispatch {
9     sub (GET) {
10       [ 200, [ 'Content-type', 'text/plain' ], [ 'Hello world!' ] ]
11     },
12     sub () {
13       [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ]
14     }
15   };
16 }
17
18 HelloWorld->run_if_script;