Skip to content

Instantly share code, notes, and snippets.

@colwilson
Created June 29, 2011 22:32
Show Gist options
  • Save colwilson/1055179 to your computer and use it in GitHub Desktop.
Save colwilson/1055179 to your computer and use it in GitHub Desktop.
from flask import Blueprint, render_template, request, current_app, jsonify, session
from flask.views import MethodView, View
blueprint = Blueprint('www', __name__)
class MyView(MethodView):
def get(self):
return request.method
def put(self):
return request.method
def post(self):
return request.method
def delete(self):
return request.method
blueprint.add_url_rule('/api/counter', view_func=MyView.as_view('MyView'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment