2021-11-20 16:39:51 +01:00
|
|
|
from flask import Flask
|
|
|
|
from flask_restful import Api, Resource
|
2021-11-21 14:17:54 +01:00
|
|
|
import os
|
2021-11-21 13:59:22 +01:00
|
|
|
import pbrAyctCore.core as core
|
2021-11-20 16:39:51 +01:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
api = Api(app)
|
|
|
|
|
|
|
|
class Hello(Resource):
|
|
|
|
def get(self):
|
2021-11-21 13:59:22 +01:00
|
|
|
return core.getTestString()
|
2021-11-20 16:39:51 +01:00
|
|
|
|
|
|
|
api.add_resource(Hello, "/hello")
|
|
|
|
|
2021-11-30 16:13:45 +01:00
|
|
|
def create_app():
|
|
|
|
return app
|
|
|
|
|
2021-11-20 16:39:51 +01:00
|
|
|
if __name__ == "__main__":
|
2021-11-21 14:17:54 +01:00
|
|
|
port = int(os.environ.get('PORT', 5000))
|
|
|
|
app.run(host = '0.0.0.0', port = port)
|