From 96f7949ac88e4ac3b02668c35f57c810ba590b2f Mon Sep 17 00:00:00 2001 From: Beaudan Date: Wed, 26 Jun 2019 14:27:42 +1000 Subject: [PATCH] Update endpoint for storage server and p2p --- js/modules/loki_rpc.js | 2 +- libloki/modules/local_loki_server.js | 2 +- libloki/test/node/local_loki_server_test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/modules/loki_rpc.js b/js/modules/loki_rpc.js index 4560156fb..43c9eb060 100644 --- a/js/modules/loki_rpc.js +++ b/js/modules/loki_rpc.js @@ -4,7 +4,7 @@ const nodeFetch = require('node-fetch'); const { parse } = require('url'); const LOKI_EPHEMKEY_HEADER = 'X-Loki-EphemKey'; -const endpointBase = '/v1/storage_rpc'; +const endpointBase = '/storage_rpc/v1'; const decryptResponse = async (response, address) => { try { diff --git a/libloki/modules/local_loki_server.js b/libloki/modules/local_loki_server.js index ed1393756..c815ce0f4 100644 --- a/libloki/modules/local_loki_server.js +++ b/libloki/modules/local_loki_server.js @@ -50,7 +50,7 @@ class LocalLokiServer extends EventEmitter { } // Check endpoints here - if (req.url === '/v1/storage_rpc') { + if (req.url === '/storage_rpc/v1') { try { const bodyObject = JSON.parse(body); if (bodyObject.method !== 'store') { diff --git a/libloki/test/node/local_loki_server_test.js b/libloki/test/node/local_loki_server_test.js index ed34b7b5f..8229a303c 100644 --- a/libloki/test/node/local_loki_server_test.js +++ b/libloki/test/node/local_loki_server_test.js @@ -74,7 +74,7 @@ describe('LocalLokiServer', () => { }); try { - await axios.post('http://localhost:8001/v1/storage_rpc', messageData); + await axios.post('http://localhost:8001/storage_rpc/v1', messageData); } catch (error) { assert.isNotOk(error, 'Error occured'); }