12 lines
319 B
Python
12 lines
319 B
Python
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
|