Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from flask import Flask, request
import api_data
import random
server_port = 5000
app = Flask(__name__)
def joke():
language = request.args.get('language', 'en')
if(language not in api_data.joke_dict):
language = 'en'
return random.choice(api_data.joke_dict[language])
if __name__ == "__main__":'',port=server_port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment