blob: 7529eaeb51428fefd8bac3a3c36cb11418151f08 [file] [log] [blame]
Shad Ansari6fcfa292022-01-28 00:34:13 +00001"""
2SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
3SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
4"""
5import sys
6
Shad Ansari1dcfdb32022-01-24 23:13:06 +00007from flask import Flask, request
8from flask_restful import Resource, Api
Shad Ansari6fcfa292022-01-28 00:34:13 +00009import logging as log
Shad Ansari1dcfdb32022-01-24 23:13:06 +000010
11app = Flask(__name__)
12api = Api(app)
13
Shad Ansari6fcfa292022-01-28 00:34:13 +000014
15class Greeting(Resource):
Shad Ansari1dcfdb32022-01-24 23:13:06 +000016 def get(self):
17 return 'Hello World!'
18
Shad Ansari6fcfa292022-01-28 00:34:13 +000019
20api.add_resource(Greeting, '/') # Route_1
Shad Ansari1dcfdb32022-01-24 23:13:06 +000021
22if __name__ == '__main__':
Shad Ansari6fcfa292022-01-28 00:34:13 +000023 log.basicConfig(
24 format='%(asctime)s %(levelname)-8s %(message)s',
25 level=log.DEBUG,
26 datefmt='%Y-%m-%d %H:%M:%S',
27 stream=sys.stdout)
28
29 log.info("Starting network-diag-app...")
30
31 app.run('0.0.0.0', '3333')