Skip to content

Commit fe72826

Browse files
committed
adding templates and changing first route
1 parent 9bad5c5 commit fe72826

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

2.15 KB
Binary file not shown.

app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
api = Api(app)
99
swagger = Swagger(app)
1010

11+
@app.route('/')
12+
def home():
13+
return "<h1 style='text-align: center'>Book review's API.</h1>"
14+
1115
class UppercaseText(Resource):
1216
def get(self):
1317
"""

templates/api_request_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import requests
2+
3+
base_url = 'http://127.0.0.1:5000/uppercase'
4+
5+
params = {'text': 'hello world'}
6+
7+
response = requests.get(url = base_url, params = params)
8+
9+
print(response)

templates/hello_world.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from flask import Flask
2+
3+
app = Flask(__name__)
4+
5+
@app.route('/')
6+
def home():
7+
return '<h1 style="text-align:center;">Hello world!</h1>'
8+
9+
if __name__ == "__main__":
10+
app.run(debug = True)

0 commit comments

Comments
 (0)