Guest User

Untitled

a guest
Feb 17th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from apiserver import ApiServer, ApiRoute
  2.  
  3. class Myserver(ApiServer):
  4. @ApiRoute("/popup")
  5. def addbar(req):
  6. print(req)
  7. return {"boo":req["bar"][0]+1}
  8.  
  9. @ApiRoute("/baz")
  10. def justret(req):
  11. if req :
  12. raise ApiError(501, "no data in for baz")
  13.  
  14. Myserver("172.24.32.43", 8080).serve_forever()
Add Comment
Please, Sign In to add comment