use Blueprints
This commit is contained in:
@@ -15,6 +15,7 @@ from cnf.config import Config
|
||||
from cnf.config_read_env import ConfigReadEnv
|
||||
from cnf.config_read_toml import ConfigReadToml
|
||||
from cnf.config_read_json import ConfigReadJson
|
||||
from web.routes import web_routes
|
||||
from modbus_tcp import ModbusTcp
|
||||
|
||||
|
||||
@@ -31,6 +32,7 @@ class ProxyState:
|
||||
|
||||
|
||||
app = Quart(__name__)
|
||||
app.register_blueprint(web_routes)
|
||||
|
||||
|
||||
@app.route('/-/ready')
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
from quart import Response
|
||||
|
||||
from server import app
|
||||
|
||||
|
||||
@app.route('/')
|
||||
async def hello():
|
||||
return Response(response="Hello, world")
|
||||
9
app/src/web/routes.py
Normal file
9
app/src/web/routes.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from quart import Blueprint
|
||||
from quart import Response
|
||||
|
||||
web_routes = Blueprint('web_routes', __name__)
|
||||
|
||||
|
||||
@web_routes.route('/')
|
||||
async def hello():
|
||||
return Response(response="Hello, world")
|
||||
@@ -1,6 +1,6 @@
|
||||
# test_with_pytest.py
|
||||
import pytest
|
||||
from web.route import app
|
||||
from server import app
|
||||
|
||||
pytest_plugins = ('pytest_asyncio',)
|
||||
|
||||
|
||||
@@ -83,7 +83,8 @@ SRC_FILES := $(wildcard $(SRC_PROXY)/*.py)\
|
||||
$(wildcard $(SRC_PROXY)/cnf/*.py)\
|
||||
$(wildcard $(SRC_PROXY)/cnf/*.toml)\
|
||||
$(wildcard $(SRC_PROXY)/gen3/*.py)\
|
||||
$(wildcard $(SRC_PROXY)/gen3plus/*.py)
|
||||
$(wildcard $(SRC_PROXY)/gen3plus/*.py)\
|
||||
$(wildcard $(SRC_PROXY)/web/*.py)
|
||||
CNF_FILES := $(wildcard $(CNF_PROXY)/*.toml)
|
||||
|
||||
# determine destination files
|
||||
|
||||
Reference in New Issue
Block a user