Skip to content

Commit 9cdca1d

Browse files
Now "/api" for GET response
1 parent ec049ee commit 9cdca1d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn app:app

app.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,25 @@
1313
reload(sys)
1414
sys.setdefaultencoding('utf-8')
1515

16-
class API(Resource):
16+
class APP(Resource):
1717
def get(self):
18-
return {'this is should become a ->': 'website'}
18+
return {'this is soon to become an awesome->': 'website'}
1919

2020
def post(self):
2121
jk = joke.getJoke()
2222
jk = jk.encode('ascii', 'ignore').decode('ascii')
2323
#jk = jk.encode('utf-8')
2424
return jk
2525

26-
api.add_resource(API, '/')
26+
class API(Resource):
27+
def get(self):
28+
jk = joke.getJoke()
29+
jk = jk.encode('ascii', 'ignore').decode('ascii')
30+
# jk = jk.encode('utf-8')
31+
return jk
32+
33+
api.add_resource(APP, '/')
34+
api.add_resource(API, '/api')
2735

2836
if __name__ == '__main__':
2937
app.run(debug=True)

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Flask==0.11.1
2+
gunicorn==19.7.0
3+
httplib2==0.9.2
4+
Jinja2==2.8
5+
virtualenv==15.1.0
6+
Werkzeug==0.11.10
7+
flask-restful

0 commit comments

Comments
 (0)