Created
January 21, 2021 01:23
-
-
Save ryan-blunden/957bfc7fdb619e5ae70a6f9728e46492 to your computer and use it in GitHub Desktop.
Chuck Norris random quote generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import requests | |
app = Flask(__name__) | |
@app.route('/') | |
def chuck_random(): | |
return requests.get('https://api.chucknorris.io/jokes/random').json()['value'] | |
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dev: | |
FLASK_ENV=development python3 chuck.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flask | |
requests | |
httpie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment