--- a/annot-server/annotserver.py Sun Oct 19 12:52:38 2014 +0200
+++ b/annot-server/annotserver.py Mon Oct 20 01:31:33 2014 +0200
@@ -7,8 +7,7 @@
from twisted.application import service, internet, strports
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
-from twisted.web import server
-from twisted.web import resource
+from twisted.web import server, resource
from twisted.web.wsgi import WSGIResource
from twisted.web.static import Data, File
@@ -22,6 +21,12 @@
WS_PORT = 8090
OSC_PORT = 9090
+class BaseRedirect(resource.Resource):
+ isLeaf = True
+ def render_GET(self, request):
+ request.redirect(request.URLPath().child('p/'))
+ return ""
+
def make_service(conn, debug=False):
s = service.MultiService()
@@ -54,8 +59,8 @@
rootWs.putChild("broadcast", wsResource)
rootWs.putChild("annot", wsAnnotResource)
-
webResource = resource.Resource()
+ webResource.putChild("",BaseRedirect())
webResource.putChild(getattr(config,'STATIC_URL').lstrip('/'), File(getattr(config,'STATIC_ROOT')))
# Create the WSGI resource
wsgiAppAsResource = WSGIResource(reactor, wsgiThreadPool, app)