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) (unidiff)
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
@@ -28,5 +28,8 @@ class ClipperzTestSite(server.Site):
28 28
29 def getResourceFor(self, request): 29 def getResourceFor(self, request):
30 if request.uri.startswith('/json') or request.uri.startswith('/dump'): 30 uri = request.uri
31 uri = uri.split("?", 1)[0]
32 uri = uri.split("#", 1)[0]
33 if uri.startswith('/json') or uri.startswith('/dump'):
31 request.site = self 34 request.site = self
32 request.sitepath = copy.copy(request.prepath) 35 request.sitepath = copy.copy(request.prepath)
@@ -34,5 +37,5 @@ class ClipperzTestSite(server.Site):
34 37
35 else: 38 else:
36 pathParts = request.uri.split('/') 39 pathParts = uri.split('/')
37 version = pathParts[1] 40 version = pathParts[1]
38 41
@@ -41,5 +44,9 @@ class ClipperzTestSite(server.Site):
41 absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2]) 44 absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
42 result = static.File(absoluteFilePath, contentType) 45 result = static.File(absoluteFilePath, contentType)
43 46 elif pathParts[2].endswith('.webapp'):
47 contentType = 'application/x-web-app-manifest+json'
48 # absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
49 absoluteFilePath = os.path.join(projectBaseDir(), 'frontend', version, 'properties', pathParts[2])
50 result = static.File(absoluteFilePath, contentType)
44 else: 51 else:
45 #http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png 52 #http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png
@@ -55,5 +62,5 @@ class ClipperzTestSite(server.Site):
55 basePath = projectBaseDir() + '/frontend' 62 basePath = projectBaseDir() + '/frontend'
56 if resourceType == 'images': 63 if resourceType == 'images':
57 fileExtension = os.path.splitext(request.uri)[1] 64 fileExtension = os.path.splitext(uri)[1]
58 if fileExtension == '.png': 65 if fileExtension == '.png':
59 contentType = 'image/png' 66 contentType = 'image/png'
@@ -76,5 +83,5 @@ class ClipperzTestSite(server.Site):
76 contentType = 'text/html' 83 contentType = 'text/html'
77 84
78 absoluteFilePath = basePath + request.uri 85 absoluteFilePath = basePath + uri
79 86
80 result = static.File(absoluteFilePath, contentType) 87 result = static.File(absoluteFilePath, contentType)
@@ -86,5 +93,5 @@ class ClipperzTestSite(server.Site):
86 93
87def main (): 94def main ():
88 site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8084, '/java-backend')) 95 site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8080, '/java-backend'))
89 reactor.listenTCP(8888, site) 96 reactor.listenTCP(8888, site)
90 reactor.run() 97 reactor.run()