works
Browse files- .gitignore +1 -0
- app.py +13 -5
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
__pycache__/app.cpython-310.pyc
|
app.py
CHANGED
@@ -1,11 +1,19 @@
|
|
1 |
-
from flask import Flask
|
2 |
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/')
|
6 |
def hello_world():
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
-
@app.route('/video_id
|
10 |
-
def get_video_id(
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, request
|
2 |
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/')
|
6 |
def hello_world():
|
7 |
+
try:
|
8 |
+
return 'Hello, World!'
|
9 |
+
except Exception as e:
|
10 |
+
return str(e)
|
11 |
|
12 |
+
@app.route('/video_id', methods=['POST'])
|
13 |
+
def get_video_id():
|
14 |
+
try:
|
15 |
+
title = request.json.get('title')
|
16 |
+
artist = request.json.get('artist')
|
17 |
+
return { 'artist': artist, 'title': title }
|
18 |
+
except Exception as e:
|
19 |
+
return str(e)
|