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')

[((8, 6, 8, 21), 'flask.Flask', 'Flask', ({(8, 12, 8, 20): '__name__'}, {}), '(__name__)', False, 'from flask import Flask\n'), ((12, 13, 12, 32), 'resources.resourcePing.main', 'resourcePing.main', ({}, {}), '()', False, 'from resources import resourcePing, resourceResolution\n'), ((14, 11, 14, 53), 'flask.Response', 'Response', (), '', False, 'from flask import Response\n'), ((18, 12, 18, 46), 'message_protocol.resolution_input.parseResolutionInput', 'parseResolutionInput', ({(18, 33, 18, 45): 'request.json'}, {}), '(request.json)', False, 'from message_protocol.resolution_input import parseResolutionInput\n'), ((19, 13, 19, 43), 'resources.resourceResolution.main', 'resourceResolution.main', ({(19, 37, 19, 42): 'input'}, {}), '(input)', False, 'from resources import resourcePing, resourceResolution\n'), ((21, 11, 21, 62), 'flask.Response', 'Response', (), '', False, 'from flask import Response\n')]