revu structure projet python
This commit is contained in:
parent
4d5290c8ed
commit
dc61708d46
0
backend/chainetv/__init__.py
Normal file
0
backend/chainetv/__init__.py
Normal file
@ -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!')
|
@ -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('/<path:path>')
|
||||
def index(path):
|
@ -1,4 +1,4 @@
|
||||
if __name__ == '__main__':
|
||||
from app import create_app
|
||||
from chainetv.app import create_app
|
||||
app= create_app()
|
||||
app.run()
|
Loading…
Reference in New Issue
Block a user