gammatools/app/routes/coinflip.py

12 lines
319 B
Python
Raw Permalink Normal View History

from flask_restx import Resource, Namespace
import random
namespace = Namespace('coinflip', description='Coinflip related operations')
@namespace.route('/', methods=['GET']) # resolves to /coinflip
class RollCoinflip(Resource):
@staticmethod
def get():
return random.choice(['Heads', 'Tails']), 200