Serving static files from Comanche Re: [Seaside] listen on a
jfitzell at gmail.com
Mon Mar 29 12:54:46 UTC 2010
While people are discussing these kinds of things, I just thought I'd
through in a reminder that you should feel free to implement your own
subclass of any of the server adaptors if you want custom behaviour.
This may make custom modifications that we don't adopt easier to
manage, and of course they will show up in the menu in the Control
Panel just like any other adaptor.
On Mon, Mar 29, 2010 at 1:05 PM, Pierce Ng <pierce at netmemetic.com> wrote:
> On Sun, Mar 28, 2010 at 10:47:59AM +0200, radoslav hodnicak wrote:
>> ^ (HttpService on: self port)
>> address: '127.0.0.1';
>> name: 'seaside-' , self port greaseString;
>> plug: self;
> In case anyone prefers serving static files from Comanche instead of using
> WAFileLibrary, here's an adaptation to Seaside 3 of some old code you may
> find on the net. (Note, I don't have the binding to 127.0.0.1 below.)
> | contentPath dirPath service ma |
> contentPath := 'htdocs'.
> dirPath := FileDirectory default fullNameFor: contentPath.
> service := HttpService on: self port
> named: 'seaside-', self port greaseString.
> ma := ModuleAssembly core.
> ma alias: '/static' to: [
> ma serverRoot: dirPath.
> ma documentRoot: dirPath.
> ma directoryIndex: 'index.html index.htm'.
> ma serveFiles ].
> ma addPlug: self.
> service plug: ma rootModule.
> ^ service
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside