Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add default app.psgi to newapp template

  • Loading branch information...
commit 9babd0532a9f87d34973f9ddd4f07703221f70a4 1 parent 8ca7cdb
@typester authored
Showing with 21 additions and 4 deletions.
  1. +2 −4 eg/app.psgi
  2. +19 −0 lib/Ark/Command/Flavor/Newapp.pm
View
6 eg/app.psgi
@@ -7,11 +7,9 @@ my $app = MyApp->new;
$app->setup;
builder {
- enable Plack::Middleware::Static
+ enable 'Plack::Middleware::Static',
path => qr{^/(js/|css/|swf/|images?/|imgs?/|static/|[^/]+\.[^/]+$)},
root => $app->path_to('root')->stringify;
- $app->psgi_handler;
+ $app->handler;
};
-
-
View
19 lib/Ark/Command/Flavor/Newapp.pm
@@ -25,6 +25,25 @@ sub setup_template_vars {
__DATA__
---
+file: app.psgi
+template: |
+ use Plack::Builder;
+ use Plack::Middleware::Static;
+
+ use [% module %];
+
+ my $app = MyApp->new;
+ $app->setup;
+
+ builder {
+ enable 'Plack::Middleware::Static',
+ path => qr{^/(js/|css/|swf/|images?/|imgs?/|static/|[^/]+\.[^/]+$)},
+ root => $app->path_to('root')->stringify;
+
+ $app->handler;
+ };
+
+---
file: Makefile.PL
template: |
use inc::Module::Install;
Please sign in to comment.
Something went wrong with that request. Please try again.