25 lines
676 B
Python
25 lines
676 B
Python
from flask import Flask, request, jsonify
|
|
import json, ifcJsonParser
|
|
|
|
app = Flask(__name__)
|
|
|
|
# First route
|
|
@app.route('/ifc-mapping', methods=['POST'])
|
|
def handle_request1():
|
|
data = request.get_json(force=True)
|
|
json_data = json.dumps(data)
|
|
print(type(data), type(json_data))
|
|
ifcJsonParser.receive_json(data)
|
|
return jsonify({"message": "Response from ifc-mapping"})
|
|
|
|
# Second route
|
|
@app.route('/endpoint2', methods=['POST'])
|
|
def handle_request2():
|
|
data = request.get_json()
|
|
# Process data
|
|
# ...
|
|
print(data)
|
|
return jsonify({"message": "Response from endpoint2"})
|
|
|
|
if __name__ == '__main__':
|
|
app.run(debug=True) |