Using Flask I can define something like
@self.app.before_request
def before_request():
if 'Authorization' not in request.headers:
abort(401)
if request.method == 'POST':
if not request.json:
abort(400)
I was wondering how I can do it with nameko
request
object before maybe calling the wrapped method. There's an example of that here: https://github.com/nameko/nameko-amqp-retry/blob/master/nameko_amqp_retry/decorators.py#L30
2017-12-19 15:35:46,472 nameko.containers DEBUG signalling result for <WorkerContext [proxy.register_action] at 0x105ce79b0>
tore down worker <WorkerContext [proxy.register_action] at 0x105ce79b0> in 0.000s
nameko run <module>
on the command line, nameko will discover any service classes defined in <module> and start them all under one runner