Hi,<div><br></div><div>finally I've managed to serve static files without using an external web server. Indeed I want to have a standalone application that's why I don't want to use an external web server.</div>
<div><br></div><div>Here's how I did, It looks hacky so I'm looking for better code. It was taken from <a href="http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html">http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html</a> with little modifications to make it works.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Object subclass: #SeaslidesServer</div><div> ....</div><div><br></div><div><div>SeaslidesServer class</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>instanceVariableNames: 'adaptor'</div>
</div><div><br></div><div><br></div><div><br></div><div><div>SeaslidesServer class>>startSeaslides</div><div> | ma seaside |</div><div><br></div><div> "Kill all existing Kom HTTP servers"</div><div> HttpService allInstancesDo: [:each | each stop. each unregister].</div>
<div><br></div><div> adaptor := (WAKom startOn: 8080).</div><div><br></div><div> ma := ModuleAssembly core.</div><div> ma serverRoot: (FileDirectory default directoryNamed: 'Bespin') fullName.</div><div> ma alias: '/seaslides' to: [ma addPlug: [:request | self processHttpRequest: request]].</div>
<div> ma alias: '/files' to: [ma addPlug: [:request | self processHttpRequest: request]].</div><div> ma documentRoot: (FileDirectory default directoryNamed: 'Bespin') fullName.</div><div> ma directoryIndex: 'index.html index.htm'.</div>
<div> ma serveFiles.</div><div><br></div><div> adaptor service plug: ma rootModule.</div></div><div><br></div><div><br></div><div><br></div><div><div>SeaslidesServer class>>processHttpRequest: aRequest</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>^ self adaptor process: aRequest</div>
</div><div><br></div><div><br></div><div>The directory Bespin is at the same level at the Seaside image. So I can access <a href="http://localhost:8080/BespinEmbedded.js">http://localhost:8080/BespinEmbedded.js</a> and all other ressources.</div>
<div><br></div><a href="http://localhost:8080/seaslides">http://localhost:8080/seaslides</a> is my application. <a href="http://localhost:8080/files">http://localhost:8080/files</a> is needed for Seaside libraires.<div><br>
</div><div>Cheers,<br><div><br clear="all">Laurent Laffont<br><br><a href="http://pharocasts.blogspot.com/">http://pharocasts.blogspot.com/</a><br><a href="http://magaloma.blogspot.com/">http://magaloma.blogspot.com/</a><br>
<br><br><div class="gmail_quote">On Sat, Sep 11, 2010 at 9:47 AM, Philippe Marschall <span dir="ltr"><<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2010/9/11 laurent laffont <<a href="mailto:laurent.laffont@gmail.com">laurent.laffont@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi,<br>
> I'm trying to create a WAFileLibrary subclass and import Bespin<br>
> Embedded. <a href="https://bespin.mozillalabs.com/docs/embedding/index.html" target="_blank">https://bespin.mozillalabs.com/docs/embedding/index.html</a><br>
> However, Bespin expects this file hierarchy to work:<br>
> ressources/<br>
> -- screen_theme/<br>
> -- theme.less<br>
> -- images<br>
> lines.png<br>
> ....<br>
> With WAFileLibrary the path to files is built using the class name.<br>
><br>
> Is there a way to choose the directory name for a WAFileLibrary ? So I can<br>
> access theme.less like this:<br>
> <a href="http://localhost:8080/BespinLibrary/ressources/screen_theme/theme.less" target="_blank">http://localhost:8080/BespinLibrary/ressources/screen_theme/theme.less</a><br>
> I know I can serve static filesusing an external Web server but I really<br>
> want to put this in the image. (Or, if possible, serve static files<br>
> via KomHttpServer or another Web server running on another port).<br>
> Laurent Laffont<br>
<br>
</div></div>The easiest is probably to create a file handler named 'resources' and<br>
override #name in your file library to answer 'screen_theme'.<br>
<br>
Cheers<br>
Philippe<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br></div></div>