MCPcopy Index your code
hub / github.com/diffgram/diffgram / Router

Class Router

local_dispatcher/local_dispatch.py:189–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187
188
189class Router():
190
191 def __init__(self, ingress : Ingress):
192
193 self.ingress = ingress
194 self.allowed_methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']
195
196 @self.ingress.app.route('/', defaults = {'path': ''}, methods = self.allowed_methods)
197 @self.ingress.app.route('/<path:path>', methods = self.allowed_methods)
198 def all_paths_proxy(path):
199
200 return ingress.route(path)
201
202
203 def prevent_default_logs(self):
204 log = logging.getLogger('werkzeug')
205 log.setLevel(logging.ERROR)
206
207
208 def start(self):
209
210 self.prevent_default_logs()
211
212 self.ingress.app.logger.setLevel(logging.INFO)
213
214 self.ingress.app.debug = False
215 self.ingress.app.run(host = '0.0.0.0', port = self.ingress.port)
216
217
218

Callers 1

local_dispatch.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected