Created
January 12, 2017 21:03
-
-
Save Frankity/edaa98a0f550be7a6780b51f4d9360dd to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
from flask import Flask, jsonify | |
from flask_cors import CORS, cross_origin | |
from flask_mail import Mail | |
from flask_sqlalchemy import SQLAlchemy | |
import os | |
app = Flask(__name__) | |
app.config['CORS_HEADERS'] = 'Content-Type' | |
app.config['SECRET_KEY'] = 'new_brand_todo_app' | |
cors = CORS(app, resources={r"v1*":{"origins": "*"}}) | |
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///todo.sqlite" | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True | |
db = SQLAlchemy(app) | |
#app.config.from_object('config') | |
@app.errorhandler(404) | |
def not_found(error): | |
return jsonify({"message":"route not found"}) | |
from api.users.controllers import mod_users as rest_users | |
from api.todos.controllers import mod_todo as rest_todos | |
app.register_blueprint(rest_users, url_prefix='/v1') | |
app.register_blueprint(rest_todos, url_prefix='/v1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment