From 124ddcebddd65837e9c445e50ec35214477dd24c Mon Sep 17 00:00:00 2001 From: Erfan Besharat Date: Wed, 14 Apr 2021 18:00:57 +0430 Subject: [PATCH] Add tunnel address public endpoint --- src/routes.js | 4 ++++ utils/protectedRoutes.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes.js b/src/routes.js index 0c105a00..e4ef8897 100644 --- a/src/routes.js +++ b/src/routes.js @@ -482,6 +482,10 @@ module.exports = async ( res.json(health) }) + app.get('/tunnel/status', async (req, res) => { + res.json({ uri: await Storage.getItem('tunnel/url') }) + }) + /** * kubernetes health check */ diff --git a/utils/protectedRoutes.js b/utils/protectedRoutes.js index fc865dc4..24b1f47e 100644 --- a/utils/protectedRoutes.js +++ b/utils/protectedRoutes.js @@ -3,6 +3,7 @@ module.exports = { GET: { "/healthz": true, "/ping": true, + "/tunnel/status": true, // Errors out when viewing an API page from the browser "/favicon.ico": true, "/api/lnd/connect": true, @@ -32,5 +33,5 @@ module.exports = { PUT: {}, DELETE: {} }, - nonEncryptedRoutes: ['/api/security/exchangeKeys', "/api/encryption/exchange", '/healthz', '/ping', '/api/lnd/wallet/status', '/api/gun/auth',"/api/subscribeStream"] + nonEncryptedRoutes: ['/api/security/exchangeKeys', "/api/encryption/exchange", '/healthz', '/ping', '/tunnel/status', '/api/lnd/wallet/status', '/api/gun/auth',"/api/subscribeStream"] } \ No newline at end of file