From ee51cfa59619c4ed850290aaee0e2f4df22ec9ac Mon Sep 17 00:00:00 2001 From: "S.Mohammad Emami Razavi" Date: Wed, 11 Aug 2021 11:29:34 +0430 Subject: [PATCH 1/2] adds api_host to configure swagger server correct --- config.example.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.example.json b/config.example.json index 25092e7..057d6d0 100644 --- a/config.example.json +++ b/config.example.json @@ -2,7 +2,8 @@ "url": "http://192.168.1.1", "login": "admin", "password": "myrouterpassword", - "api_listen_host": "127.0.0.1", + "api_listen_host": "0.0.0.0", + "api_host": "127.0.0.1", "api_listen_port": 3000, "api_users": { "apiuser": "pleasechangeme" }, "api_client_url": "http://localhost:3000", From 4e6b544767eb186f7ed088a45924860c5e20e8ac Mon Sep 17 00:00:00 2001 From: "S.Mohammad Emami Razavi" Date: Wed, 11 Aug 2021 11:30:22 +0430 Subject: [PATCH 2/2] changes server path of swagger --- api-bridge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-bridge.js b/api-bridge.js index 5b2ebc5..0feef01 100755 --- a/api-bridge.js +++ b/api-bridge.js @@ -61,7 +61,7 @@ const options = { }, servers: [ { - url: `http://${config.api_listen_host}:${config.api_listen_port}/api/v1` + url: `http://${config.api_host}:${config.api_listen_port}/api/v1` } ] }, @@ -80,4 +80,4 @@ app.get( }) ); -app.listen(config.api_listen_port, config.api_listen_host, () => logger.info(`Api bridge listening at http://${config.api_listen_host}:${config.api_listen_port}`)) \ No newline at end of file +app.listen(config.api_listen_port, config.api_listen_host, () => logger.info(`Api bridge listening at http://${config.api_listen_host}:${config.api_listen_port}`))