Example #1
0
from app import app
from app.library import dotenv

if __name__ == "__main__":
    app.run(
        debug=dotenv.getBoolean("DEBUG"),
        host=dotenv.getString("APP_HOST"),
        port=dotenv.getString("APP_PORT")
    )
Example #2
0
from app.library import dotenv

GLOBAL_SETTING = {'api_version': dotenv.getString('APP_VERSION')}
from app import app
from app.library import dotenv

if __name__ == "__main__":
    app.run(debug=dotenv.getBoolean("DEBUG"),
            host=dotenv.getString("APP_HOST"),
            port=dotenv.getInt("APP_PORT"))
Example #4
0
from app.library import dotenv

REDIS_SETTING = {
    'host': dotenv.getString('REDIS_HOST'),
    'port': dotenv.getString('REDIS_PORT'),
    'database': dotenv.getInt('REDIS_DB'),
    'password': dotenv.getString('REDIS_PASSWORD'),
    'expired': dotenv.getInt('REDIS_EXPIRED'),
    'prefix': dotenv.getString('REDIS_PREFIX')
}
from app import app
import logging
from werkzeug.routing import PathConverter
from flask_cors import CORS
from app.library import dotenv
from app.library import api_helper as Helper
from app.controller.welcome_controller import WelcomeController

CORS(app,
     supports_credentials=True,
     origins=dotenv.getString("ALLOW_ORIGIN"),
     send_wildcard=True)

log = logging.getLogger('werkzeug')
log.setLevel(logging.DEBUG)


# Converter Url
class EverythingConverter(PathConverter):
    regex = '.*?'


app.url_map.converters['everything'] = EverythingConverter
# END converter


# Router Basic #
@app.route("/", methods=["GET"])
def get_hello():
    return WelcomeController().index()
Example #6
0
from app.library import dotenv
import os

LOG_SETTING = {
    'log_level': dotenv.getString('ERR_LOG_LEVEL'),
    'port': dotenv.getString('APP_PORT'),
    'max_bytes': dotenv.getInt('ERR_LOG_MAXBYTES'),
    'backup_count': dotenv.getInt('ERR_LOG_BACKUP_COUNT'),
    'location': dotenv.getString('ERR_LOG_LOCATION')
}

from app.library import dotenv

LOG_SETTING = {
    'log_level': dotenv.getString('ERR_LOG_LEVEL'),
    'port': dotenv.getString('APP_PORT')
}