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__) app = Flask(__name__)
job_manager = JobManager()
@app.route('/', methods=['GET','POST']) @app.route('/', methods=['GET','POST'])
def index(): def index():
if request.method == 'GET': if request.method == 'GET':
render(index.html) render(index.html)
else: 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