Update speedyf/main.py

This commit is contained in:
Fred Boniface 2024-04-30 21:38:18 +01:00
parent 42caef4beb
commit 2464c9bf7c
1 changed files with 13 additions and 5 deletions

View File

@ -2,12 +2,20 @@ from flask import Flask, render_template, jsonify, request
app = Flask(__name__)
job_manager = JobManager()
@app.route('/', methods=['GET','POST'])
def generate_uuid():
return "random uuid"
@app.route('/')
def index():
if request.method == 'GET':
render(index.html)
else:
handleform()
render(index.html)
@app.route('/new_job', methods=['POST'])
def new_job():
## READ FORM, WRITE FILE TO DISK, CALL JOB RUNNER, RETURN JOB_ID
job_id = generate_uuid()
ctx = {job_id: job_id, job_manager: job_manager}
handle_file(file_path, ctx)
@app.route('/job_status')
def job_status():