##// END OF EJS Templates
http: added service backend for testing communication, and extracting vcsserver version...
marcink -
r102:da6339df default
parent child Browse files
Show More
@@ -182,6 +182,7 b' class HTTPApplication(object):'
182 182 name='msgpack',
183 183 factory=self._msgpack_renderer_factory)
184 184
185 self.config.add_route('service', '/_service')
185 186 self.config.add_route('status', '/status')
186 187 self.config.add_route('hg_proxy', '/proxy/hg')
187 188 self.config.add_route('git_proxy', '/proxy/git')
@@ -191,6 +192,9 b' class HTTPApplication(object):'
191 192
192 193 self.config.add_view(
193 194 self.status_view, route_name='status', renderer='json')
195 self.config.add_view(
196 self.service_view, route_name='service', renderer='msgpack')
197
194 198 self.config.add_view(self.hg_proxy(), route_name='hg_proxy')
195 199 self.config.add_view(self.git_proxy(), route_name='git_proxy')
196 200 self.config.add_view(
@@ -249,6 +253,19 b' class HTTPApplication(object):'
249 253 def status_view(self, request):
250 254 return {'status': 'OK'}
251 255
256 def service_view(self, request):
257 import vcsserver
258 payload = msgpack.unpackb(request.body, use_list=True)
259 resp = {
260 'id': payload.get('id'),
261 'result': dict(
262 version=vcsserver.__version__,
263 config={},
264 payload=payload,
265 )
266 }
267 return resp
268
252 269 def _msgpack_renderer_factory(self, info):
253 270 def _render(value, system):
254 271 value = msgpack.packb(value)
General Comments 0
You need to be logged in to leave comments. Login now