Last active
June 4, 2023 22:00
-
-
Save afresh1/f1720f75b3d52ac8f643 to your computer and use it in GitHub Desktop.
A Mojolicious One Liner to serve static files from the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec perl -Mojo -E '$m=a("/");$m->static->paths(["."]);$m->start' daemon |
Fancy! Also a choice is this one with Plack::App::Directory that ships with Plack and uses plackup
from there as well.
#!/bin/sh
exec plackup -MPlack::App::Directory -e 'Plack::App::Directory->new' "$@"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A modern (2021) version uses Mojolicious::Plugin::Directory (separate install):