Re: Mason and HTTP::Server::Simple::Mason
Pedro Melo <[email protected]> Sun, 15 Sep 2013 09:12:29 +0100
| Newsgroups | gmane.comp.web.mason.user |
|---|---|
| Message-ID | <CACCxPi1e5+KCYw_ubCeOLRZELL3Y7g+qpNxVBfgfa+Potrw+Gg@mail.gmail.com> |
Hi, I don't think HTTP::Server::Simple (on which HTTP::Server::Simple::Mason is based) ever handled static content unless you create you own handler for it. Your best bet is probably to write a small PSGI app that creates an instance of a Mason, processes the request path, and sends back the output. This way you can then use Plack::Builder to mount it and use the Static files middleware to take care of your static content for you. And as a bonus, you'll end up with something that can make use of any of the wonderfull HTTP servers that Plack supports, like Starman. Here, I made a demo for you: https://github.com/melo/pocs/tree/master/mason_simple_server Just follow the steps in the README. Bye, On Sat, Sep 14, 2013 at 12:10 PM, Николай Кинаш <[email protected]>wrote: > Hi. > I use HTTP::Server::Simple::Mason for deploying Mason web application. > > My conf: > > #!/usr/bin/perl -w > use strict; > use HTTP::Server::Simple::Mason; > my $server = MyApp::Server->new(666)->background(); > print "Use 'kill $server' to stop server.\n"; > package MyApp::Server; > use base qw/HTTP::Server::Simple::Mason/; > > sub mason_config { > return ( comp_root => '/usr/local/webapp/'); > } > > Request: localhost:666/images/map.png return: > �PNG IHDR ��a pHYs � � �o�d �IDATx�mSKHTa �� sǙ�QJ� 5�F-(�H)�HB-����� > ��V�Z�� � > How i can stop Mason Parser for this image? > > I put "return -1 if $r->uri() =~ m|^/images|;" in autohandler(i don`t have > handler.pl) > but he return just -1 )) > > Any ideas? > > Thanks. > Best Regards > Nikolay Kinash, > > > > > ------------------------------------------------------------------------------ > LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! > 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, > SharePoint > 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack > includes > Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. > http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk > _______________________________________________ > Mason-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mason-users > > -- Pedro Melo @pedromelo http://www.simplicidade.org/ xmpp:[email protected] mailto:[email protected] ------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk _______________________________________________ Mason-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mason-users