Spaces:
Runtime error
Runtime error
File size: 577 Bytes
f91510c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from flask import Flask, render_template, request
from promptStuff.main import main
app = Flask(__name__)
# Route to serve the HTML page with the text form
@app.route('/')
def form():
return render_template('text_form.html')
# Route to handle the form submission and send the text to the API endpoint
@app.route('/api/endpoint', methods=['POST'])
def process_text():
arxiv_link = request.form['text']
main(arxiv_link)
return f'Thanks for submitting this link: {arxiv_link}'
if __name__ == '__main__':
app.run(debug=True)
|