add dxweb app
[spider.git] / dxweb / lib / DXWeb.pm
diff --git a/dxweb/lib/DXWeb.pm b/dxweb/lib/DXWeb.pm
new file mode 100644 (file)
index 0000000..68c5dcd
--- /dev/null
@@ -0,0 +1,21 @@
+package DXWeb;
+use Mojo::Base 'Mojolicious';
+
+# This method will run once at server start
+sub startup {
+  my $self = shift;
+
+  # Load configuration from hash returned by "my_app.conf"
+  my $config = $self->plugin('Config');
+
+  # Documentation browser under "/perldoc"
+  $self->plugin('PODRenderer') if $config->{perldoc};
+
+  # Router
+  my $r = $self->routes;
+
+  # Normal route to controller
+  $r->get('/')->to('example#welcome');
+}
+
+1;