用 Flask-RESTful 来构建 RESTful API
-
安装注册flask_restful
-
定义路由
circle_plugins.py
# restful api
from flask_restful import Api
api = Api()
api.add_resource(
BlogArticleApi,
'/api/article',
'/api/article/<int:id>',
endpoint='restful_api_blog_article'
)
api.add_resource(
BlogAuthApi,
'/api/auth',
endpoint='restful_api_auth'
)
app/controllers/blog
网友评论