1 #!/usr/bin/env python 2 3 from WebStack.Adapters.BaseHTTPRequestHandler import deploy 4 from WebStack.Resources.ResourceMap import MapResource 5 from WebStack.Resources.Static import DirectoryResource 6 import Configurator 7 import os 8 9 # Get the directory of the application. 10 11 directory = os.path.split(Configurator.__file__)[0] 12 13 # Make a simple Web site. 14 15 resource = MapResource({ 16 "styles" : DirectoryResource(os.path.join(directory, "Resources", "styles"), {"css" : "text/css"}), 17 None : Configurator.ConfiguratorResource() 18 }) 19 20 # Special magic incantation. 21 22 print "Serving..." 23 deploy(resource, handle_errors=0) 24 25 # vim: tabstop=4 expandtab shiftwidth=4