first commit

This commit is contained in:
Martin
2016-04-18 20:56:24 +02:00
commit ae3a566f68
13 changed files with 195 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
from api.helpers import JSONEncoder
app = Flask(__name__)
app.config.from_object('config')
# enable this when json encoding works
# app.json_encoder = JSONEncoder
def on_404(e):
return jsonify(dict(error='Not found')), 404
app.errorhandler(404)(on_404)
#SQLAlchemy
db = SQLAlchemy(app)
from api.views import designers
app.register_blueprint(designers.mod)
@app.route("/")
def index():
data = {
"info": {
"api_version": "0.0.1"
}
}
return jsonify(data)