Skip to content

Instantly share code, notes, and snippets.

@pythononwheels
Last active February 8, 2019 14:43
Show Gist options
  • Save pythononwheels/44c2f1c33cfbdc223fd90021f6f67cdb to your computer and use it in GitHub Desktop.
Save pythononwheels/44c2f1c33cfbdc223fd90021f6f67cdb to your computer and use it in GitHub Desktop.
@app.add_rest_routes("task")
class Task(BaseHandler):
#
# every pow handler automatically gets these RESTful routes
# when you add the : app.add_rest_routes() decorator.
#
# 1 GET /todo #=> list
# 2 GET /todo/<uuid:identifier> #=> show
# 3 GET /todo/new #=> new
# 4 GET /todo/<uuid:identifier>/edit #=> edit
# 5 GET /todo/page/<uuid:identifier> #=> page
# 6 GET /todo/search #=> search
# 7 PUT /todo/<uuid:identifier> #=> update
# 8 PUT /todo #=> update (You have to send the id as json payload)
# 9 POST /todo #=> create
# 10 DELETE /todo/<uuid:identifier> #=> destroy
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment