Optional hostname and port
All checks were successful
Build Base Application / Build (push) Successful in 1m32s

This commit is contained in:
retoor 2024-12-06 21:01:57 +01:00
parent 6ee266d3ac
commit e3b70d8a51

View File

@ -38,8 +38,12 @@ class BaseApplication(web.Application):
middlewares.append(self.session_middleware) middlewares.append(self.session_middleware)
super().__init__(middlewares=middlewares, *args, **kwargs) super().__init__(middlewares=middlewares, *args, **kwargs)
def run(self, *args, **kwargs): def run(self, *args, **kwargs):
web.run_app(self, *args, **kwargs) if kwargs.get('port'):
if not kwargs.get('host'):
kwargs['host'] = '127.0.0.1'
web.run_app(self, *args, **kwargs)
async def authenticate(self, username, password): async def authenticate(self, username, password):
return self.basic_username == username and self.basic_password == password return self.basic_username == username and self.basic_password == password