2 # Copyright (c) 2019 AT&T Intellectual Property. #
\r
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
5 # you may not use this file except in compliance with the License. #
\r
6 # You may obtain a copy of the License at #
\r
8 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
10 # Unless required by applicable law or agreed to in writing, software #
\r
11 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
13 # See the License for the specific language governing permissions and #
\r
14 # limitations under the License. #
\r
15 ################################################################################
\r
16 # File name: a1-sdnc-vth.py #
\r
17 # Description: vth for A1 service #
\r
18 # Date created: 04/22/2020 #
\r
19 # Last modified: 04/30/2020 #
\r
20 # Python Version: 3.7.4 #
\r
21 # Author: Raul Gomez (rg9907) #
\r
22 # Email: rg9907@att.com #
\r
23 ################################################################################
\r
26 from logging import FileHandler
\r
27 from flask import Flask
\r
28 from flask.logging import create_logger
\r
29 from app.routes import ROUTES, ERRORS
\r
30 #from dotenv import load_dotenv
\r
34 # redirect http to https
\r
35 APP = Flask(__name__)
\r
36 LOG = create_logger(APP)
\r
38 # Prevents print statement every time an endpoint is triggered.
\r
39 logging.getLogger("werkzeug").setLevel(logging.DEBUG)
\r
40 #logging.getLogger("werkzeug").setLevel(logging.WARNING)
\r
41 APP.register_blueprint(ERRORS)
\r
42 APP.register_blueprint(ROUTES, url_prefix="/otf/vth/oran/a1/v1")
\r
44 if __name__ == '__main__':
\r
45 LOG_HANDLER = FileHandler('a1-sdnc-vth.log', mode='a')
\r
46 LOG_HANDLER.setLevel(logging.INFO)
\r
47 LOG.setLevel(logging.INFO)
\r
48 LOG.addHandler(LOG_HANDLER)
\r
49 # context = ('opt/cert/otf.pem', 'opt/cert/privateKey.pem')
\r
50 # app.run(debug = False, host = '0.0.0.0', port = 5000, ssl_context = context)
\r
51 APP.run(debug=False, host='0.0.0.0', port=6001)
\r