Advertisement
Guest User

Untitled

a guest
Apr 1st, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. from flask import Flask
  2. from flask_restful import Resource, Api
  3.  
  4. app = Flask(__name__)
  5. api = Api(app)
  6. todos = {}
  7. @app.route('/')
  8. def home():
  9. return 'this works'
  10.  
  11.  
  12. class TodoSimple(Resource):
  13. def get(self):
  14. return 'blah'
  15. # return {todo_id: todos[todo_id]}
  16.  
  17. api.add_resource(TodoSimple, '/test') # Getting a 404 for this route on http://127.0.0.1:5000/test
  18.  
  19. if __name__ == '__main__':
  20. app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement