Update speedyf/main.py

This commit is contained in:
Fred Boniface 2024-04-30 21:04:46 +01:00
parent 33c94d64c1
commit 8804dcb9ad

View File

@ -1,10 +1,16 @@
from flask import Flask, render_template
from flask import Flask, render_template, jsonify, request
app = Flask(__name__)
job_manager = JobManager()
@app.route('/', methods=['GET','POST'])
def index():
if request.method == 'GET':
render(index.html)
else:
handleform()
handleform()
@app.route('/job_status')
def job_status():
job_id = request.args.get('job_id')
job_info = job_manager.get_job_status(job_id)
return jsonify(job_info), 200