Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, jsonify, request
|
2 |
+
|
3 |
+
app = Flask(__name__)
|
4 |
+
|
5 |
+
@app.route('/')
|
6 |
+
def hello():
|
7 |
+
name = request.args.get('name', '')
|
8 |
+
if name:
|
9 |
+
message = f'Hello, {name}!'
|
10 |
+
else:
|
11 |
+
message = 'Hello!'
|
12 |
+
return jsonify(message=message)
|
13 |
+
|
14 |
+
if __name__ == '__main__':
|
15 |
+
app.run()
|