aboutsummaryrefslogtreecommitdiff
path: root/api/routes/default/index.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-03-30 01:09:30 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-03-30 01:09:30 +0300
commite2da6d2db20093ebd2a65aad35c9991ab1a02176 (patch)
treee5c77a8f4a6fd106b13b659e248cab5768d07cdc /api/routes/default/index.js
parenta4901ad47d2945e9a6c6616661840c97ebbf03e7 (diff)
downloadarching-kaos-tools-e2da6d2db20093ebd2a65aad35c9991ab1a02176.tar.gz
arching-kaos-tools-e2da6d2db20093ebd2a65aad35c9991ab1a02176.tar.bz2
arching-kaos-tools-e2da6d2db20093ebd2a65aad35c9991ab1a02176.zip
Introducing an HTTP JSON API
Diffstat (limited to 'api/routes/default/index.js')
-rw-r--r--api/routes/default/index.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/api/routes/default/index.js b/api/routes/default/index.js
new file mode 100644
index 0000000..e9be5cb
--- /dev/null
+++ b/api/routes/default/index.js
@@ -0,0 +1,22 @@
+const settings = require('../../settings');
+module.exports = (req, res) => {
+ res.send({
+ message:"Hello! Welcome to Arching Kaos API! See available routes below!",
+ routes:{
+ GET:[
+ {welcome:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+"/"},
+ {node_local_chain:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/chain"},
+ {node_local_zlatest:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/zlatest"},
+ {gathered_zblocks:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/see"},
+ {gathered_zchain_zlatest_pairs:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/seens"},
+ {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"}
+ ],
+ POST:[
+ {send_me_a_zchain_link:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/szch"},
+ {send_me_a_zblock:settings.DEF_PROTO+settings.LOCAL_IP+":"+settings.PORT+settings.URL_PREFIX+"/sblk"},
+ ]
+ }
+ });
+}
+