diff --git a/backend/Jsonfile.py b/backend/chainetv/Jsonfile.py similarity index 100% rename from backend/Jsonfile.py rename to backend/chainetv/Jsonfile.py diff --git a/backend/ReverseProxied.py b/backend/chainetv/ReverseProxied.py similarity index 100% rename from backend/ReverseProxied.py rename to backend/chainetv/ReverseProxied.py diff --git a/backend/chainetv/__init__.py b/backend/chainetv/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/api.py b/backend/chainetv/api.py similarity index 93% rename from backend/api.py rename to backend/chainetv/api.py index 2fae157..8383852 100644 --- a/backend/api.py +++ b/backend/chainetv/api.py @@ -1,11 +1,10 @@ from flask import Blueprint, jsonify, request,make_response,redirect,url_for,render_template -from Jsonfile import JSONfile -import emission +from chainetv.Jsonfile import JSONfile +from chainetv import emission data= JSONfile("chaine.json") + + api = Blueprint("api", __name__) - - - @api.route('/ping', methods=['GET']) def ping_pong(): return jsonify('pong!') diff --git a/backend/app.py b/backend/chainetv/app.py similarity index 86% rename from backend/app.py rename to backend/chainetv/app.py index 1a10cf0..ecf4a2c 100644 --- a/backend/app.py +++ b/backend/chainetv/app.py @@ -1,12 +1,13 @@ from flask import Flask,render_template from flask_cors import CORS -from api import api + #from ReverseProxied import ReverseProxied def create_app(app_name=__name__): app=Flask(__name__, static_folder= "./dist/static",template_folder="./dist") - app.config.from_object('config.BaseConfig') + app.config.from_object('chainetv.config.BaseConfig') #app.wsgi_app = ReverseProxied(app.wsgi_app) CORS(app) + from chainetv.api import api app.register_blueprint(api, url_prefix="/api/v1") @app.route('/') def index(path): diff --git a/backend/chaine.json b/backend/chainetv/chaine.json similarity index 100% rename from backend/chaine.json rename to backend/chainetv/chaine.json diff --git a/backend/config.py b/backend/chainetv/config.py similarity index 100% rename from backend/config.py rename to backend/chainetv/config.py diff --git a/backend/emission.py b/backend/chainetv/emission.py similarity index 100% rename from backend/emission.py rename to backend/chainetv/emission.py diff --git a/backend/run.py b/backend/run.py index 3b426ae..b7a98cb 100644 --- a/backend/run.py +++ b/backend/run.py @@ -1,4 +1,4 @@ if __name__ == '__main__': - from app import create_app + from chainetv.app import create_app app= create_app() app.run() \ No newline at end of file