[Box-Admins] serving files from box4

Chris Cunnington websela at yahoo.com
Thu Mar 20 18:49:28 UTC 2014


locator at: (ALPath / 'favicon.ico')
		put: (ALFileResource on: (FSLocator imageDirectory / 'squeakfavicon.ico') resolve)

This code is in the current squeak.org image for the favicon, which is a file in the imageDirectory. The simplest thing is for Altitude to be fed a path to wherever Levente wants to put the files for the homepage. The files currently served from my webpage could then be dropped into that directory. Then I can change the absolute references to my site to the disk from: 

html footer: [ html img src: 'http://www.chriscunnington.com/poweredsqueak.png'].

to something like: 

html footer: [ html img src: (ALPath / 'poweredbysqueak.png') ].

That is if the image will handle it's own files. If we are separating static and dynamic requests in nginx  for speed and such, then I think I need to change the links to something in Altitude like: 

html footer: [ html img src: '/img/foo.jpg' ].

with a locator like: 

locator at: (ALPath / 'img' / 'foo.jpg') put: (ALFileResource on: FSReference * 'img' / 'foo.jpg')

where nginx sees the token /img/ and sends the request to wherever the static files are served from. 


Chris 



More information about the Box-Admins mailing list