Skip to content

Instantly share code, notes, and snippets.

@olawalejarvis
Created June 20, 2018 19:46
Show Gist options
  • Save olawalejarvis/a0dc4a5e179a1569b10c682585db027e to your computer and use it in GitHub Desktop.
Save olawalejarvis/a0dc4a5e179a1569b10c682585db027e to your computer and use it in GitHub Desktop.
python_tutorial17
#src/app.py
from flask import Flask
from .config import app_config
from .models import db, bcrypt
# import user_api blueprint
from .views.UserView import user_api as user_blueprint # add this line
def create_app(env_name):
"""
Create app
"""
# app initiliazation
#####################
# existing code remain #
######################
app.register_blueprint(user_blueprint, url_prefix='/api/v1/users') # add this line
@app.route('/', methods=['GET'])
def index():
"""
example endpoint
"""
return 'Congratulations! Your first endpoint is working'
return app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment