mirror of
https://github.com/NovaOSS/LingoSynth.git
synced 2024-11-25 22:43:57 +01:00
18 lines
401 B
Python
18 lines
401 B
Python
import time
|
|
import flask
|
|
|
|
def register(app: flask.Flask):
|
|
@app.route('/api/rephrase', methods=['GET', 'POST'])
|
|
@app.rate_limiter.limit('2 per second')
|
|
def api_rephrase():
|
|
text = flask.request.args.get('text') or flask.request.json.get('text')
|
|
|
|
time.sleep(3)
|
|
raise
|
|
|
|
return flask.jsonify(
|
|
{
|
|
'text': 'Done.'
|
|
}
|
|
)
|