from flask import Flask
from flask import request
from flask import Response
from resources import resourcePing, resourceResolution
from message_protocol.resolution_input import parseResolutionInput
import json

app = Flask(__name__)

@app.route('/ping', methods=['GET'])
def ping():
    output = resourcePing.main()
    json = output.toJSON()
    return Response(json, mimetype='appliction/json')

@app.route('/resolution', methods=['POST'])
def resolution():
    input = parseResolutionInput(request.json)
    output = resourceResolution.main(input)
    output_json = json.dumps(output)
    return Response(output_json, mimetype='appliccation/json')

[((218, 233), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'from flask import Flask\n'), ((297, 316), 'resources.resourcePing.main', 'resourcePing.main', ([], {}), '()\n', (314, 316), False, 'from resources import resourcePing, resourceResolution\n'), ((355, 397), 'flask.Response', 'Response', (['json'], {'mimetype': '"""appliction/json"""'}), "(json, mimetype='appliction/json')\n", (363, 397), False, 'from flask import Response\n'), ((473, 507), 'message_protocol.resolution_input.parseResolutionInput', 'parseResolutionInput', (['request.json'], {}), '(request.json)\n', (493, 507), False, 'from message_protocol.resolution_input import parseResolutionInput\n'), ((521, 551), 'resources.resourceResolution.main', 'resourceResolution.main', (['input'], {}), '(input)\n', (544, 551), False, 'from resources import resourcePing, resourceResolution\n'), ((570, 588), 'json.dumps', 'json.dumps', (['output'], {}), '(output)\n', (580, 588), False, 'import json\n'), ((600, 651), 'flask.Response', 'Response', (['output_json'], {'mimetype': '"""appliccation/json"""'}), "(output_json, mimetype='appliccation/json')\n", (608, 651), False, 'from flask import Response\n')]