[Seaside] What is the recommended setup to develop locally (on
Mac OSX Lion) with Pharo and Seaside?
Paul DeBruicker
pdebruic at gmail.com
Sun Jan 8 20:18:50 UTC 2012
You can also set up Comanche to serve static files by subclassing
WAComancheAdaptor and adding a method like:
createService
| contentPath dirPath svc ma |
contentPath := 'htdocs'.
dirPath := FileDirectory default fullNameFor: contentPath.
svc := (HttpService on: self port) name: 'seaside-' , self port
greaseString.
ma := ModuleAssembly core.
ma
alias: '/js'
to: [
ma serverRoot: dirPath.
ma documentRoot: dirPath , '/js'.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles ].
ma
alias: '/css'
to: [
ma serverRoot: dirPath.
ma documentRoot: dirPath , '/css'.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles ].
ma
alias: '/images'
to: [
ma serverRoot: dirPath.
ma documentRoot: dirPath , '/images'.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles ].
ma
alias: '/fonts'
to: [
ma serverRoot: dirPath.
ma documentRoot: dirPath , '/fonts'.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles ].
ma addPlug: self.
svc plug: ma rootModule.
^ svc
Then starting your new adaptor from the Seaside Control Panel or
programmatically. Then set your resourceBaseUrl to '' when you
initialize your app e.g.:
app preferenceAt: #resourceBaseUrl put: '';
Any reference like
anHtmlRoot stylesheet resourceUrl:'css/style.css'
will point to the file in
<Pharo Image Directory>/htdocs/css/style.css
On 12-01-08 11:26 AM, Johan Brichau wrote:
> Hi Helene,
>
> If you do not want to setup a front-end webserver on your development machine (like me), you can easily serve static files via Comanche/Seaside.
>
> The Seaside-FileSystem package from the http://www.squeaksource.com/Seaside30LGPL repository contains the necessary functionality to easily do this.
>
> From the Seaside configuration webpage, you can then add a 'File directory' (as an application). This allows you to serve files from a directory on disk via the built-in webserver of the Smalltalk image.
>
> Hope that sets you on your way!
>
> cheers
> Johan
>
> On 08 Jan 2012, at 20:06, Helene Bilbo wrote:
>
>> As long i was working without the possibility to upload files in my seaside
>> application i just worked with the seaside one-click image. Now i wonder
>> what is the best way to develop on a local machine when working with static
>> files - when on the server where the application will run later it will run
>> with apache like described in the book in chapter 22.3.
>>
>> 1) I read on the newsgroups that it is not recommended to work via RFB
>> directly on the real server (where the application will run later).
>> 2) Is the best option a local installation of apache? How do I configure it
>> (on Mac OSX Lion)? Is it easy to migrate the application to the real server
>> (where the application will run later) this way?
>> 3) Is it a good option to let the Pharo/Comanche Server do the serving of
>> static files while developing on the local machine? How do I configure it?
>> What do I have to change when i start uploading the application to the real
>> (where the application will run later) server?
>>
>> I know this has been asked on the newsgroups many times and there were many
>> answers - but for a beginner like me with no prior experience in
>> (web)developing thats the biggest obstacle up to now.. A small tutorial for
>> this task would be very welcome on the seaside homepage or in the book.
>>
>> Best regards, Helene.
>>
>> --
>> View this message in context: http://forum.world.st/What-is-the-recommended-setup-to-develop-locally-on-Mac-OSX-Lion-with-Pharo-and-Seaside-tp4276453p4276453.html
>> Sent from the Seaside General mailing list archive at Nabble.com.
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list