[albatross-users] [patch] HTTPServer static resources

Matt Goodall matt at pollenation.net
Tue Jul 22 00:46:34 EST 2003


Hi,

Attached is a patch against 1.10 that allows HTTPServer to serve static 
resources (images, stylesheets etc) directly from the filesystem with no 
help from the Albatross application. An example of its use is:

    from albatross import httpdapp

    app = new MyAlbatrossApp()
    static_resources = {
        '/images': './images',
        '/styles': 'somewhere/styles'
        }
    httpd = httpdapp.HTTPServer(app, 8000, static_resources)
    httpd.serve_forever()

static_resources is an _optional_ dictionary, mapping uri to filesystem 
paths. Note that this change is not yet reflected in the al-httpd script 
but the script still works in the same way as before.

Hope this is useful.

Cheers, Matt

-- 
Matt Goodall, Pollenation Internet Ltd
w: http://www.pollenationinternet.com
e: matt at pollenation.net

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: httpdapp-staticresources.patch
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20030721/9f11024d/attachment.ksh>


More information about the Albatross-users mailing list