SHARE
TWEET

Untitled

a guest Feb 17th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top