first commit
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user