add hello-world.cgi example as file
Matt S Trout [Mon, 30 Nov 2009 22:54:00 +0000 (22:54 +0000)]
examples/hello-world/hello-world.cgi [new file with mode: 0644]

diff --git a/examples/hello-world/hello-world.cgi b/examples/hello-world/hello-world.cgi
new file mode 100644 (file)
index 0000000..b24dc02
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use Web::Simple 'HelloWorld';
+
+{
+  package HelloWorld;
+
+  dispatch {
+    sub (GET) {
+      [ 200, [ 'Content-type', 'text/plain' ], [ 'Hello world!' ] ]
+    },
+    sub () {
+      [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ]
+    }
+  };
+}
+
+HelloWorld->run_if_script;