This repository has been archived on 2020-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
producer-endpoint/endpoints.py
Torma Kristóf b0adf42de9
All checks were successful
continuous-integration/drone/push Build is passing
use json serialization
2020-04-21 22:55:39 +02:00

14 lines
377 B
Python

import json
from redisclient import redis_client
from flask import jsonify
from flask_classful import FlaskView
class IPEndpoint(FlaskView):
def post(self):
consumer = json.loads(redis_client.get('currentConsumer'))
consumer['Host'] = request.json['ip']
strconsumer = json.dumps(consumer)
redis_client.set('currentConsumer', strconsumer)