Upload files to "ifcParser"
This commit is contained in:
25
ifcParser/main-mapping.py
Normal file
25
ifcParser/main-mapping.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user