SHARE
TWEET

Untitled

a guest Oct 13th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from flask import Flask
  2.  
  3. list_of_names=[]
  4.  
  5. app = Flask(__name__)
  6.  
  7. @app.route("/name/add", methods=["POST"])
  8. def name_add(name):
  9.     list_of_names.append(name)
  10.  
  11. @app.route("/names", methods=["GET"])
  12. def names():
  13.     return list_of_names
  14.  
  15. @app.route("/name/remove", methods=["DELETE"])
  16. def names(name):
  17.     list_of_names.remove(name)
  18.  
  19. if __name__ == "__main__":
  20.     app.run()
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