Usernado
Quick links
Current version: 0.3 (download from PyPI, Change Log)
Source Github
Found a bug? don’t hesitate to report it here
Hello, world
Here is a simple “Hello, world” example for Usernado:
from usernado import APIHandler, api_route
from tornado import web, ioloop
@api_route("/hello", name="hello")
class Hello(APIHandler):
def get(self):
self.response({"message": "Hello, world"})
def make_app():
return web.Application(api_route.urls, autoreload=True)
def main():
app = make_app()
app.listen(8000)
ioloop.IOLoop.current().start()
if __name__ == "__main__":
main()
Then you can test it via Curl or other HTTP Clients.
$ curl localhost:8000/hello