<gh_stars>10-100
#  FinSim
#  Copyright 2018 <NAME>. All Rights Reserved.
#  NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
#  Released under a MIT (SEI)-style license, please see license.txt or contact <EMAIL> for full terms.

#Old __init__.py used to create initial Flask app
import os

from flask import Flask
from flask_restful import Api
from finsim-trans.resources.card import Card
from finsim-trans.resources.bank import Bank

def create_app(test_config=None):

    # create and configure the app
    app = Flask( __name__, instance_relative_config=True )
    app.config.from_mapping(
        SECRET_KEY='dev',
        DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
    )

    api = Api( app )

    api.add_resource( Card, '/card' )
    api.add_resource( Bank, '/bank' )

    #if test_config is None:
    #    # load the instance config, if it exists, when not testing
    #    app.config.from_pyfile('config.py', silent=True)
    #else:
    #    # load the test config if passed in
    #    app.config.from_mapping(test_config)

    # ensure the instance folder exists
    #try:
    #    os.makedirs( app.instance_path )
    #except OSError:
    #    pass

    # a simple page that says hello
    #@app.route('/hello')
    #def hello():
    #    return 'Hello, World!'

    return app

#  FinSim
#  Copyright 2018 <NAME>. All Rights Reserved.
#  NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
#  Released under a MIT (SEI)-style license, please see license.txt or contact <EMAIL> for full terms.

#Old __init__.py used to create initial Flask app
import os

from flask import Flask
from flask_restful import Api
from finsim-trans.resources.card import Card
from finsim-trans.resources.bank import Bank

def create_app(test_config=None):

    # create and configure the app
    app = Flask( __name__, instance_relative_config=True )
    app.config.from_mapping(
        SECRET_KEY='dev',
        DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
    )

    api = Api( app )

    api.add_resource( Card, '/card' )
    api.add_resource( Bank, '/bank' )

    #if test_config is None:
    #    # load the instance config, if it exists, when not testing
    #    app.config.from_pyfile('config.py', silent=True)
    #else:
    #    # load the test config if passed in
    #    app.config.from_mapping(test_config)

    # ensure the instance folder exists
    #try:
    #    os.makedirs( app.instance_path )
    #except OSError:
    #    pass

    # a simple page that says hello
    #@app.route('/hello')
    #def hello():
    #    return 'Hello, World!'

    return app
#  FinSim #  Copyright 2018 <NAME>. All Rights Reserved. #  NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. #  Released under a MIT (SEI)-style license, please see license.txt or contact <EMAIL> for full terms. #Old __init__.py used to create initial Flask app # create and configure the app #if test_config is None: #    # load the instance config, if it exists, when not testing #    app.config.from_pyfile('config.py', silent=True) #else: #    # load the test config if passed in #    app.config.from_mapping(test_config) # ensure the instance folder exists #try: #    os.makedirs( app.instance_path ) #except OSError: #    pass # a simple page that says hello #@app.route('/hello') #def hello(): #    return 'Hello, World!'