Set blueprint paths in main app

Make blueprints more self-contained for no apparent reason.
This commit is contained in:
Timotej Lazar 2023-12-04 09:46:37 +01:00
parent abc7a0728b
commit 32b182856d
6 changed files with 10 additions and 10 deletions

View file

@ -48,19 +48,19 @@ def create_app(test_config=None):
system.init_app(app)
from . import config
app.register_blueprint(config.blueprint)
app.register_blueprint(config.blueprint, url_prefix='/config')
from . import ipsets
app.register_blueprint(ipsets.blueprint)
app.register_blueprint(ipsets.blueprint, url_prefix='/ipsets')
from . import nat
app.register_blueprint(nat.blueprint)
app.register_blueprint(nat.blueprint, url_prefix='/nat')
from . import rules
app.register_blueprint(rules.blueprint)
app.register_blueprint(rules.blueprint, url_prefix='/rules')
from . import vpn
app.register_blueprint(vpn.blueprint)
app.register_blueprint(vpn.blueprint, url_prefix='/vpn')
@app.route('/')
@flask_login.login_required

View file

@ -6,7 +6,7 @@ import flask_login
from . import db
from . import system
blueprint = flask.Blueprint('config', __name__, url_prefix='/config')
blueprint = flask.Blueprint('config', __name__)
@blueprint.route('/', methods=('GET', 'POST'))
@flask_login.login_required

View file

@ -6,7 +6,7 @@ import flask_login
from . import db
from . import system
blueprint = flask.Blueprint('ipsets', __name__, url_prefix='/ipsets')
blueprint = flask.Blueprint('ipsets', __name__)
@blueprint.route('/', methods=('GET', 'POST'))
@flask_login.login_required

View file

@ -4,7 +4,7 @@ import flask_login
from . import db
from . import system
blueprint = flask.Blueprint('nat', __name__, url_prefix='/nat')
blueprint = flask.Blueprint('nat', __name__)
@blueprint.route('/', methods=('GET', 'POST'))
@flask_login.login_required

View file

@ -4,7 +4,7 @@ import flask_login
from . import db
from . import system
blueprint = flask.Blueprint('rules', __name__, url_prefix='/rules')
blueprint = flask.Blueprint('rules', __name__)
@blueprint.route('/', methods=('GET', 'POST'))
@flask_login.login_required

View file

@ -10,7 +10,7 @@ import flask_login
from . import db
from . import system
blueprint = flask.Blueprint('vpn', __name__, url_prefix='/vpn')
blueprint = flask.Blueprint('vpn', __name__)
wgkey_regex = re.compile(r'^[A-Za-z0-9/+=]{44}$')
@blueprint.route('/')