Skip to content

Commit 1383dd3

Browse files
committed
make serverを、GitHub Pagesと同様のルーティングするようにする
1 parent a79ca7e commit 1383dd3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ clean:
55
test:
66
carton install && carton exec -- prove -Ilib -r t
77
server:
8-
carton exec -- plackup -R public/ -p 5555 --host localhost -MPlack::App::Directory -e 'Plack::App::Directory->new({root => "public"})->to_app'
8+
carton exec -- plackup -R public/ -p 5555 --host localhost script/app.psgi

script/app.psgi

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use Plack::Builder;
2+
3+
builder {
4+
enable "Plack::Middleware::Static",
5+
path => sub {
6+
s!/([^\.]+)$!/$1/!;
7+
s!(.*/$)!$1/index.html! or return qr{^/.+};
8+
},
9+
root => './public/';
10+
};

0 commit comments

Comments
 (0)