summaryrefslogtreecommitdiff
path: root/scripts/proxy
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2013-08-30 15:56:53 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2013-08-30 21:23:42 (UTC)
commit20bea94ab6b91c85b171dcf86baba0a64169d508 (patch) (side-by-side diff)
tree6e38e91498dcdb861620eba1e237d1026fe79cc5 /scripts/proxy
parentbde3c7b98523112ade9c5bbf7390c4ecb494cd2e (diff)
downloadclipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.zip
clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.gz
clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.bz2
First release of /delta version
Diffstat (limited to 'scripts/proxy') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/proxy/main.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/proxy/main.py b/scripts/proxy/main.py
index 107ba16..8ce4989 100755
--- a/scripts/proxy/main.py
+++ b/scripts/proxy/main.py
@@ -27,20 +27,27 @@ class ClipperzTestSite(server.Site):
def getResourceFor(self, request):
- if request.uri.startswith('/json') or request.uri.startswith('/dump'):
+ uri = request.uri
+ uri = uri.split("?", 1)[0]
+ uri = uri.split("#", 1)[0]
+ if uri.startswith('/json') or uri.startswith('/dump'):
request.site = self
request.sitepath = copy.copy(request.prepath)
result = resource.getChildForRequest(self.resource, request)
else:
- pathParts = request.uri.split('/')
+ pathParts = uri.split('/')
version = pathParts[1]
if pathParts[2].startswith('index.'):
contentType = 'text/html'
absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
result = static.File(absoluteFilePath, contentType)
-
+ elif pathParts[2].endswith('.webapp'):
+ contentType = 'application/x-web-app-manifest+json'
+# absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
+ absoluteFilePath = os.path.join(projectBaseDir(), 'frontend', version, 'properties', pathParts[2])
+ result = static.File(absoluteFilePath, contentType)
else:
# http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png
# pathParts: ['', 'beta', 'css', 'clipperz', 'images', 'loginInfoBackground.png']
@@ -54,7 +61,7 @@ class ClipperzTestSite(server.Site):
basePath = projectBaseDir() + '/frontend'
if resourceType == 'images':
- fileExtension = os.path.splitext(request.uri)[1]
+ fileExtension = os.path.splitext(uri)[1]
if fileExtension == '.png':
contentType = 'image/png'
elif fileExtension == '.jpg':
@@ -75,7 +82,7 @@ class ClipperzTestSite(server.Site):
else:
contentType = 'text/html'
- absoluteFilePath = basePath + request.uri
+ absoluteFilePath = basePath + uri
result = static.File(absoluteFilePath, contentType)
@@ -85,7 +92,7 @@ class ClipperzTestSite(server.Site):
def main ():
- site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8084, '/java-backend'))
+ site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8080, '/java-backend'))
reactor.listenTCP(8888, site)
reactor.run()