def create_app(self):
     return create_app('../config/test.py')
Exemple #2
0
""" This script will start the webservice, provided the environment is
correctly set up. The path to a config file must be passed to the script as a
command-line argument, and additional arguments may be passed - see script
help.
"""


import argparse
import os

from bbws import create_app

parser = argparse.ArgumentParser(description='BookBrainz Web Service')
parser.add_argument(
    'config', type=str,
    help='the configuration file used to initialize the application'
)
parser.add_argument('-d', '--debug', action='store_true')
parser.add_argument('--host', type=str, default='0.0.0.0',
                    help='the desired hostname/IP for the server')
parser.add_argument('--port', type=int, default=5000,
                    help='the desired port number for the server')

args = parser.parse_args()

# Use absolute path here, otherwise config.from_pyfile makes it invalid.
app = create_app(os.path.abspath(args.config))

if __name__ == '__main__':
    app.run(debug=args.debug, host=args.host, port=args.port)
 def create_app(self):
     self.app = create_app('../config/test.py')
     return self.app
Exemple #4
0
 def create_app(self):
     return create_app('../config/test.py')