Skip to content

Instantly share code, notes, and snippets.

@agalera
Created September 23, 2016 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agalera/61db7b40d11ab73eb665308ba75e2479 to your computer and use it in GitHub Desktop.
Save agalera/61db7b40d11ab73eb665308ba75e2479 to your computer and use it in GitHub Desktop.
import falcon
api = falcon.API()
def get(url):
def wrap_function(func):
print(url)
api.add_route(url, type('Dummie', (object, ), {'on_get': func}))
return func
return wrap_function
@get('/')
def prueba(req, resp):
resp.body = "pepe"
# gunicorn file:api -b 0.0.0.0:1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment