app = Flask(__name__)
flow2 = Thread(target=morrowind, daemon=True)
flow2.start()
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
app.debug = True
app.run()
headers: {
Authentication: 'secret'
}
let user = {
name: 'John',
surname: 'Smith'
};
app = Flask(__name__)
@app.route('/')
def hello_world():
hook = result() # Определение функции в переменную. ДА, ТАК НУЖНО.
return render_template('index.html', hook = hook)
@app.route('/about')
def infos():
hook = result()
return jsonify(res="hook)
<div class="container">
<p class="lead" > {{hook}} </p>
button type="button" class="btn btn-outline-secondary" >ROLL</button>
</div>
<script>
async function clicer(){
let url = 'http://127.0.0.1:5000/about'
let response = await fetch(url);
let commits = await response.json()
alert(commits.res)
}
</script>