Код: Выделить всё
def create_inspector(app):
inspector = Sanic(configure_logging=False)
inspector.config['KEEP_ALIVE'] = False
inspector.app = app
inspector.add_route(render_status, '/')
inspector.add_route(get_status, '/api/status')
return inspector
Код: Выделить всё
curl -k http://localhost:9504/api/123
Код: Выделить всё
File "/opt/product/4.0.0.1/lib64/python3.6/site-packages/sanic/app.py", line 546, in handle_request
handler, args, kwargs, uri = self.router.get(request)
File "/opt/product/4.0.0.1/lib64/python3.6/site-packages/sanic/router.py", line 344, in get
return self._get(request.path, request.method, '')
File "/opt/product/4.0.0.1/lib64/python3.6/site-packages/sanic/router.py", line 393, in _get
raise NotFound('Requested URL {} not found'.format(url))
sanic.exceptions.NotFound: Requested URL /api/123 not found
Подробнее здесь: https://stackoverflow.com/questions/786 ... ned-routes