implement vuex et authent #2
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 flask import Blueprint, jsonify, request,make_response,redirect,url_for,render_template
|
||||||
from Jsonfile import JSONfile
|
from chainetv.Jsonfile import JSONfile
|
||||||
import emission
|
from chainetv import emission
|
||||||
data= JSONfile("chaine.json")
|
data= JSONfile("chaine.json")
|
||||||
|
|
||||||
|
|
||||||
api = Blueprint("api", __name__)
|
api = Blueprint("api", __name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api.route('/ping', methods=['GET'])
|
@api.route('/ping', methods=['GET'])
|
||||||
def ping_pong():
|
def ping_pong():
|
||||||
return jsonify('pong!')
|
return jsonify('pong!')
|
@ -1,12 +1,13 @@
|
|||||||
from flask import Flask,render_template
|
from flask import Flask,render_template
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from api import api
|
|
||||||
#from ReverseProxied import ReverseProxied
|
#from ReverseProxied import ReverseProxied
|
||||||
def create_app(app_name=__name__):
|
def create_app(app_name=__name__):
|
||||||
app=Flask(__name__, static_folder= "./dist/static",template_folder="./dist")
|
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)
|
#app.wsgi_app = ReverseProxied(app.wsgi_app)
|
||||||
CORS(app)
|
CORS(app)
|
||||||
|
from chainetv.api import api
|
||||||
app.register_blueprint(api, url_prefix="/api/v1")
|
app.register_blueprint(api, url_prefix="/api/v1")
|
||||||
@app.route('/<path:path>')
|
@app.route('/<path:path>')
|
||||||
def index(path):
|
def index(path):
|
@ -1,4 +1,4 @@
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from app import create_app
|
from chainetv.app import create_app
|
||||||
app= create_app()
|
app= create_app()
|
||||||
app.run()
|
app.run()
|
Loading…
Reference in New Issue
Block a user