Last active
May 31, 2020 04:26
-
-
Save ardydedase/136cae75130938d5e4a5b083aefe40f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask_restful import Api | |
| from resources import HealthCheck, \ | |
| UserList, User | |
| from models import User as UserModel, db | |
| from flask_migrate import Migrate | |
| from app import create_app | |
| app = create_app() | |
| migrate = Migrate(app, db) | |
| # API | |
| api = Api(app) | |
| api.add_resource(HealthCheck, '/healthcheck') | |
| api.add_resource(UserList, '/api/users') | |
| api.add_resource(User, '/api/user/<username>') | |
| # CLI for migrations | |
| @app.shell_context_processor | |
| def make_shell_context(): | |
| return dict(app=app, db=db, User=UserModel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment