mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Una possibile idea che sto per eliminare
This commit is contained in:
parent
6b00d3410a
commit
812ec627e8
3 changed files with 15 additions and 0 deletions
0
royalnet/web/__init__.py
Normal file
0
royalnet/web/__init__.py
Normal file
0
royalnet/web/blueprints/__init__.py
Normal file
0
royalnet/web/blueprints/__init__.py
Normal file
15
royalnet/web/flaskserver.py
Normal file
15
royalnet/web/flaskserver.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import typing
|
||||
import flask as f
|
||||
from ..database import Alchemy
|
||||
|
||||
|
||||
class RoyalFlask:
|
||||
def __init__(self, config_obj: typing.Type):
|
||||
self.app = f.Flask(__name__)
|
||||
self.app.config.from_object(config_obj)
|
||||
self.alchemy = Alchemy(self.app.config["RF_DATABASE_URI"], self.app.config["RF_REQUIRED_TABLES"])
|
||||
for blueprint in self.app.config["RF_BLUEPRINTS"]:
|
||||
self.app.register_blueprint(blueprint)
|
||||
|
||||
def debug(self):
|
||||
self.app.run(host="127.0.0.1", port=1234, debug=True)
|
Loading…
Reference in a new issue