[Catalyst] Serving a static document

matthew couchman (JIC) matthew.couchman at bbsrc.ac.uk
Fri Oct 2 15:26:46 GMT 2009


Thanks, I didn't know about Catalyst::Plugin::Static::Simple but that looks like just what I am after.

> -----Original Message-----
> From: Kieren Diment [mailto:diment at gmail.com]
> Sent: 02 October 2009 12:28
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Serving a static document
> 
> 
> On 02/10/2009, at 9:13 PM, matthew couchman (JIC) wrote:
> 
> > Hello,
> >
> > I'm quite new to Catalyst so apologies if this is a naive question.
> > I'm trying to create a KML document within catalyst and then
> > redirect the server to that document. The problem I'm having is that
> > Catalyst seems to be interpreting the URL of the document (e.g.
> http://localhost:3000/root/src/test.kml)
> >  as a call to a script which it doesn't recognise and so it reverts
> > to the default page. How do I override this behaviour?
> >
> 
> Something like this (untested):
> 
> sub thing :Path('test.kml') {
>    my ($self, $c) = @_;
>    $c->serve_static_file('relative/path/from/app/root/to/test.kml');
> }
> 
> or similar.  Catalyst::Plugin::Static::Simple does the dirty work for
> you.
> 
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-
> archive.com/catalyst at lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list