fixed set restport by default 1337

This commit is contained in:
mh4x0f 2020-11-15 08:40:14 -03:00
parent c8e5fe2c40
commit 26a3754b16
4 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
- fixed hide error object of type QProcess on WorkProcess class #93
- fixed settings dhcp for allow to change dhcp configuration
- fixed error when execute from github actions
- fixed set restport by default 1337
## [Released]

View File

@ -132,3 +132,4 @@ EXTENSIONS="blueprints.restapi:init_app", "ext.database:init_app", "ext.auth:ini
USERNAME=wp3admin
PASSWORD=admin
public_id=""
port=1337

View File

@ -53,6 +53,7 @@ def parser_args_func(parse_args, config):
config.set_one("ap_mode", "restapi", True)
config.set("rest_api_settings", "PASSWORD", parse_args.password)
config.set("rest_api_settings", "USERNAME", parse_args.username)
config.set("rest_api_settings", "port", parse_args.restport)
server_restapi = RestControllerAPI("wp3API", config)
thead = threading.Thread(target=server_restapi.run)
thead.setDaemon(True)

View File

@ -23,8 +23,9 @@ class RestControllerAPI(object):
def __init__(self, name, config):
self.conf = config
self.app = Flask(name)
self.port_rest = self.conf.get("rest_api_settings", "port")
configuration.init_app(self.app, self.conf)
configuration.load_extensions(self.app)
def run(self):
self.app.run(debug=False)
self.app.run(debug=False, port=self.port_rest)