--- a/annot-server/annotserver.py Wed Oct 08 18:08:52 2014 +0200
+++ b/annot-server/annotserver.py Thu Oct 09 08:44:36 2014 +0200
@@ -8,8 +8,9 @@
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
from twisted.web import server
+from twisted.web import resource
from twisted.web.wsgi import WSGIResource
-from twisted.web.static import Data
+from twisted.web.static import Data, File
from oscserver import OSCServerProtocol
from websockets import BroadcastServerFactory, AnotationServerFactory
@@ -53,12 +54,16 @@
rootWs.putChild("annot", wsAnnotResource)
+ webResource = resource.Resource()
+ webResource.putChild(config['static_url'], File(config['static_root']))
# Create the WSGI resource
wsgiAppAsResource = WSGIResource(reactor, wsgiThreadPool, app)
+ webResource.putChild('', wsgiAppAsResource)
+
# Hooks for twistd
- webserver = strports.service('tcp:%d' % config.get('web_port',WEB_PORT), server.Site(wsgiAppAsResource))
+ webserver = strports.service('tcp:%d' % config.get('web_port',WEB_PORT), server.Site(webResource))
webserver.setServiceParent(s)
wsserver = strports.service('tcp:%d' % config.get('ws_port',WS_PORT), server.Site(rootWs))