Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

andersoncardoso/flaskle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is?

This is a small monkey patch on flask.Flask() to add bottle-like decorators for get/post/delete/put

Instalation?

pip install flaskle

Usage

from flask import Flask
import flaskle

flaskle.patch()
app = Flask(__name__)

@app.get('/feature/')
def feature_get():
    # ... your 'get' view here
    return my_get_return

@app.post('/feature/')
def feature_post():
    # ...your 'post' view here
    return my_post_return

@app.put('/feature/')
def feature_put():
    # ...your 'put' view here
    return my_put_return

@app.delete('/feature/')
def feature_delete():
    # ...your 'delete' view here
    return my_delete_return

@app.get('/other/one/')
@app.post('/other/one/')
def get_and_post_view():
    # view code here
    return {'some': 'thing'}

if __name__ == '__main__':
    app.run()

About

bottle-like get/post/delete/put decorators for flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages