-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (26 loc) · 828 Bytes
/
app.py
File metadata and controls
38 lines (26 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import logging
import os
from flask import Flask
from api import api
import config
# from models import db
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s]: {} %(levelname)s %(message)s'.format(os.getpid()),
datefmt='%Y-%m-%d %H:%M:%S',
handlers=[logging.StreamHandler()])
LOGGER = logging.getLogger()
def create_app():
LOGGER.info('Starting app in %s environment', config.APP_ENV)
app = Flask(__name__)
app.config.from_object('config')
api.init_app(app)
# initialize SQLAlchemy
# db.init_app(app)
# define hello world page
@app.route('/')
def hello_world():
return 'Hello, World!'
return app
if __name__ == "__main__":
app = create_app()
app.run(host='0.0.0.0', port=8888, debug=True)