Flask - Background Tasks
Given this Flask code snippet, what will be the output when accessing
/status/task1 if tasks = {'task1': 'running'}?
from flask import Flask, jsonify
app = Flask(__name__)
tasks = {'task1': 'running'}
@app.route('/status/<task_id>')
def status(task_id):
state = tasks.get(task_id, 'not found')
return jsonify({'task': task_id, 'status': state})