Skip to content

Instantly share code, notes, and snippets.

@AzMoo
Created April 7, 2016 02:20
Show Gist options
  • Save AzMoo/5fbdc52af076349dc2ca4a8fb959c10c to your computer and use it in GitHub Desktop.
Save AzMoo/5fbdc52af076349dc2ca4a8fb959c10c to your computer and use it in GitHub Desktop.
# filename: happy_birthday.py
"""A basic (single function) API written using hug"""
import hug
@hug.type(extend=hug.types.number)
def extend_test(value):
print(value)
@hug.get('/happy_birthday')
def happy_birthday(name, age:extend_test=1):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment