Iliad + Swazoo + static files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Iliad + Swazoo + static files

thiago_sl
Hi list,
I am trying to use Swazoo to serve static files with iliad, without
success (  --> error 404). For now, i dont want to use apache.
Basically i did (based in the only example i see, in swazoo site):

        | site composite resource |
        composite := CompositeResource new uriPattern: '/'.
        resource := FileResource uriPattern: 'hello.html' filePath: '/path/to/
my/static/file'.
  composite addResource: resource.

        site :=  self siteClass default port: 8888.
  site addResource: composite.

        SwazooServer startSite: self siteClass defaultName

I dont know what i am doing wrong here. any suggestions?

cheers,
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: Iliad + Swazoo + static files

thiago_sl
The method is in  SwazooIliad class.

>         | site composite resource |
>         composite := CompositeResource new uriPattern: '/'.
>         resource := FileResource uriPattern: 'hello.html' filePath: '/path/to/
> my/static/file'.
>         composite addResource: resource.
>
>         site :=  self siteClass default port: 8888.
>         site addResource: composite.
>
>         SwazooServer startSite: self siteClass defaultName
>
Reply | Threaded
Open this post in threaded view
|

Re: Iliad + Swazoo + static files

Nicolas Petton
Hi,

I would port ILDiskDirectory from the GST version of Iliad to handle
this.

https://github.com/NicolasPetton/iliad/blob/master/Core/GST/ILDiskDirectory.st

It would make things a lot easier :)

Cheers,
Nico

On Wed, 2011-10-19 at 18:17 -0700, Thiago SL wrote:

> The method is in  SwazooIliad class.
>
> >         | site composite resource |
> >         composite := CompositeResource new uriPattern: '/'.
> >         resource := FileResource uriPattern: 'hello.html' filePath: '/path/to/
> > my/static/file'.
> >         composite addResource: resource.
> >
> >         site :=  self siteClass default port: 8888.
> >         site addResource: composite.
> >
> >         SwazooServer startSite: self siteClass defaultName
> >