From 6dcaab9064863b5642bcc3f96c8395174797923b Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 12 Dec 2024 05:28:46 +0200 Subject: Welcome JSON message now provides points of entry for each route based on the host that is reached through --- api/routes/default/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'api') diff --git a/api/routes/default/index.js b/api/routes/default/index.js index 6cdb5f4..c9f6bd3 100644 --- a/api/routes/default/index.js +++ b/api/routes/default/index.js @@ -9,18 +9,18 @@ module.exports = (req, res) => { routes:{ GET:[ - {welcome:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+"/"}, - {gathered_zblocks:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/see"}, - {node_local_chain:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/chain"}, - {node_local_peers:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/peers"}, - {node_local_info:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/node_info"}, - {node_local_zlatest:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/zlatest"}, - {latest_known_mined_block:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/slatest"}, - {show_mined_block:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/sblock"}, - {getMerkleTree:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/mrk/:mkr"}, + {welcome:settings.DEF_PROTO+req.headers.host+"/"}, + {gathered_zblocks:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/see"}, + {node_local_chain:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/chain"}, + {node_local_peers:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/peers"}, + {node_local_info:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/node_info"}, + {node_local_zlatest:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/zlatest"}, + {latest_known_mined_block:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/slatest"}, + {show_mined_block:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/sblock"}, + {getMerkleTree:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/mrk/:mkr"}, ], POST:[ - {send_me_a_zblock:settings.DEF_PROTO+"["+settings.LOCAL_IP+"]:"+settings.PORT+settings.URL_PREFIX+"/announce/zblock"}, + {send_me_a_zblock:settings.DEF_PROTO+req.headers.host+settings.URL_PREFIX+"/announce/zblock"}, ] } })); -- cgit v1.2.3