Kovács Bence
644c2df888
All checks were successful
continuous-integration/drone/push Build is passing
18 lines
464 B
Python
18 lines
464 B
Python
import json
|
|
from redisclient import redis_client
|
|
from flask import request, Response
|
|
from flask_classful import FlaskView
|
|
|
|
|
|
class IPEndpoint(FlaskView):
|
|
|
|
route_base = '/ip'
|
|
|
|
def post(self):
|
|
consumer = json.loads(redis_client.get('currentConsumer'))
|
|
consumer['Host'] = request.json['ip']
|
|
strconsumer = json.dumps(consumer).encode('utf-8')
|
|
redis_client.set('currentConsumer', strconsumer)
|
|
|
|
return Response(status=204)
|