amougou-fortiss commited on
Commit
be882a8
·
verified ·
1 Parent(s): 933afc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, request, jsonify
2
+
3
+ app = Flask(__name__)
4
+
5
+ @app.route('/')
6
+ def index():
7
+ return '''
8
+ <form action="/reverse" method="post">
9
+ Enter text: <input name="text" />
10
+ <input type="submit" />
11
+ </form>
12
+ '''
13
+
14
+ @app.route('/reverse', methods=['POST'])
15
+ def reverse():
16
+ text = request.form.get('text', '')
17
+ return f"<p>Reversed: {text[::-1]}</p><a href='/'>Try again</a>"
18
+
19
+ if __name__ == '__main__':
20
+ app.run(host='0.0.0.0', port=7860)