zack commited on
Commit
4d7c2c6
1 Parent(s): 83e5165

🔧 Update backend app configuration

Browse files
Files changed (1) hide show
  1. backend/app.py +9 -0
backend/app.py CHANGED
@@ -65,6 +65,15 @@ def Root():
65
  # return jsonify({"executed" : True,
66
  # "process" : "ended" })
67
 
 
 
 
 
 
 
 
 
 
68
  @app.route("/api/preview_vnc", methods=["POST"])
69
  def preview_vnc():
70
  data = request.json
 
65
  # return jsonify({"executed" : True,
66
  # "process" : "ended" })
67
 
68
+ @app.route("/api/iframe/source", methods=["POST"])
69
+ def iframe_source():
70
+ data = request.json
71
+ if data['type'] == 'gradio':
72
+ port = data['port']
73
+ src_href = f'http://localhost:{port}'
74
+ return jsonify({"iframe_src": src_href})
75
+ return jsonify({"error": "Invalid iframe type"}), 400
76
+
77
  @app.route("/api/preview_vnc", methods=["POST"])
78
  def preview_vnc():
79
  data = request.json