-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from flask import Flask | ||
|
||
from app.resources.answers import answers_bp | ||
from app.resources.questions import questions_bp | ||
|
||
|
||
def create_app(): | ||
app = Flask(__name__) | ||
app.register_blueprint(answers_bp) | ||
app.register_blueprint(questions_bp) | ||
return app |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from flask import Blueprint | ||
from flask_restful import Api, Resource | ||
|
||
answers_bp = Blueprint('answers', __name__) | ||
api = Api(answers_bp) | ||
|
||
|
||
class Answer(Resource): | ||
|
||
def get(self, answer_id=None): | ||
if answer_id: | ||
return "<h1>Answer for user with id {}</h1>".format(answer_id) | ||
else: | ||
pass | ||
|
||
def post(self): | ||
# Implement POST method | ||
pass | ||
|
||
|
||
api.add_resource(Answer, '/answers', '/answers/<int:answer_id>') |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from flask import Blueprint | ||
from flask_restful import Api, Resource | ||
|
||
questions_bp = Blueprint('questions', __name__) | ||
api = Api(questions_bp) | ||
|
||
|
||
class Question(Resource): | ||
|
||
def get(self, question_id=None): | ||
if question_id: | ||
return "<h1>Question for user with id {}</h1>".format(question_id) | ||
else: | ||
pass | ||
|
||
def post(self): | ||
# Implement POST method | ||
pass | ||
|
||
|
||
api.add_resource(Question, '/questions', '/questions/<int:question_id>') |
This file contains 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