Perl Advent Calendar 24 æ¥ç®ã® 2 è¨äºç®ã§ã(å³å¯)
ã«ã¸ã¥ã¢ã«ã« HTTP ãµã¼ãã建ã¦ãã³ãã³ã PAD ã®ç´¹ä»ããã¾ãã
Plack::App::Directory
ã®ç¥ã§ãã
æ°å¹´å YAPC ã® LT-THON ã§è©±ããã ãã§æåèµ·ãããã¦ããªãã£ããã¿ã§ãããä¸é¨çéã§ã¯ç´°ã ã¨ä½¿ããã¦ããããã§ãã
使ãæ¹
使ãæ¹ã¯è³ã£ã¦ç°¡åã§ãã¤ã³ã¹ãã¼ã«ãã¦èµ·åããã ãã§ãã
$ cpanm PAD
$ pad
HTTP::Server::PSGI: Accepting connections at http://0:5000/
ããã§ã«ã¬ã³ããã£ã¬ã¯ããªä»¥ä¸ããã¼ã 5000 ã§ãµã¼ããããããã«ãªãã¾ãããã¼ããå¤ãããå ´åã¯æ¬¡ã®ããã«ã
$ pad Static --port 8080
ãã©ã°ã¤ã³
ãã©ã°ã¤ã³ãå®è£ ããã°ç¹å®ã®ãã¡ã¤ã«ã«å¦çããã¾ããã¬ã¹ãã³ã¹ãè¿ãã¾ãã
ããã©ã«ã㧠Markdown Plugin ãå ¥ã£ã¦ããã®ã§ãããçä¼¼ã¦å®è£ ããã°ã
- ç»åãªãµã¤ã¸ã³ã°ãã¸ãã¯ã®çµæããã©ã¦ã¶ã§ç¢ºèª
- shipit ç´åã® POD ã®ã¬ã³ããªã³ã°çµæ確èªï¼ããã¯å®è£ ãã¦ããã°ããã£ãï¼
ãªã©ãªã©å¤¢ãã²ãããããã§ããã
ã¤ã³ã¿ã¼ãã§ã¤ã¹
CLI ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®æªãããã£ã¦ãå¤ãããã¨æãã¤ã¤ã解決çãæãã¤ããªãã®ã§ããæããªã¤ã³ã¿ã¼ãã§ã¤ã¹ä½ããããªããã²ããããã ããã
- ãã©ã°ã¤ã³ãã²ã¨ã¤ããèªã¿è¾¼ããªã
- ãã©ã°ã¤ã³ã«ãªãã·ã§ã³æ¸¡ãã«ãã
ãããã解決ã§ãããå¬ããæãã
ã¾ã¨ã
plackup -MPlack::App::Directory -e 'Plack::App::Directory->new->to_app'
ããã¿ã¤ãã³ã°é 95% æ¸ã§ä¾¿å©ã
ã¡ãªã¿ã« PAD ã¨ä½ã®é¢ä¿ããªãã§ããã ãã¼ã¿ãã¼ã¹ã®ã³ãã¯ã·ã§ã³ç®¡ç㯠DBIx::Handler ãããã¹ããªå®è£ ã«ãªã£ã¦ããã®ã§ããããã§ãã
ææ¥ã¯å¤§åã @songmu ããã«ããç¥ã¨ã³ããªã¼ã§ãã