diff options
author | Daniel Smith <[email protected]> | 2024-10-14 10:13:17 +0200 |
---|---|---|
committer | Daniel Smith <[email protected]> | 2025-02-24 10:33:08 +0000 |
commit | 0a43fdf4cf2c65374cd097c9ab729aa607a26d27 (patch) | |
tree | de22248a9854752e04ea0754e868c08dd76a2b5c | |
parent | f7c6fc29ca6484712086fecb3dc54dddea86f017 (diff) |
Also requires updating the interface binding to 0.0.0.0
to accept non-localhost requests.
Change-Id: I029eb8e0d249e7f170f91fbc9b2764b2b1c76ab6
Reviewed-by: Daniel Smith <[email protected]>
-rw-r--r-- | main.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -327,15 +327,19 @@ async def handle(request): return web.Response(status=200) +async def getStatus(request): + return web.Response(text='OK') + async def run_web_server(): """ Run the web server. """ app = web.Application() + app.add_routes([web.get('/status', getStatus)]) app.add_routes([web.post('/', handle)]) runner = web.AppRunner(app) await runner.setup() port = os.environ.get("PORT") or 8088 - site = web.TCPSite(runner, 'localhost', port) + site = web.TCPSite(runner, '0.0.0.0', port) await site.start() log.info("Web server started on port %s", port) |