From fe367f664e9b615c7039ce8667ff57b512206413 Mon Sep 17 00:00:00 2001 From: James Wang Date: Wed, 23 Dec 2015 17:53:00 -0500 Subject: [PATCH] Load api as blueprint within app.py --- server/api/__init__.py | 3 ++- server/app.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/api/__init__.py b/server/api/__init__.py index 2c4eac3..42138ea 100644 --- a/server/api/__init__.py +++ b/server/api/__init__.py @@ -1 +1,2 @@ -import models \ No newline at end of file +import models +import api diff --git a/server/app.py b/server/app.py index 197d279..77cffc5 100644 --- a/server/app.py +++ b/server/app.py @@ -4,8 +4,11 @@ from flask import Flask import config import json +from api.api import api + app = Flask(__name__) app.secret_key = config.SECRET +app.register_blueprint(api) @app.route("/api") def api(): @@ -28,4 +31,4 @@ if __name__ == "__main__": db.create_all() print db - app.run(host="0.0.0.0", port=8000) \ No newline at end of file + app.run(host="0.0.0.0", port=8000)