# Front API: the only service the fuzzer sees, and the only one with the coverage agent.
import requests
from flask import Flask, jsonify, abort, request
from waitress import serve

app = Flask(__name__)

@app.post('/quote')
def quote():
    data = request.get_json(silent=True) or {}
    r = requests.post('http://wf-pricing:6000/price', json=data, timeout=2)
    if r.status_code != 200:
        abort(502)
    return jsonify(r.json())

serve(app, host='0.0.0.0', port=5000, threads=8)
