Update endpoint for storage server and p2p

pull/314/head
Beaudan 6 years ago
parent 436af1a990
commit 96f7949ac8

@ -4,7 +4,7 @@ const nodeFetch = require('node-fetch');
const { parse } = require('url'); const { parse } = require('url');
const LOKI_EPHEMKEY_HEADER = 'X-Loki-EphemKey'; const LOKI_EPHEMKEY_HEADER = 'X-Loki-EphemKey';
const endpointBase = '/v1/storage_rpc'; const endpointBase = '/storage_rpc/v1';
const decryptResponse = async (response, address) => { const decryptResponse = async (response, address) => {
try { try {

@ -50,7 +50,7 @@ class LocalLokiServer extends EventEmitter {
} }
// Check endpoints here // Check endpoints here
if (req.url === '/v1/storage_rpc') { if (req.url === '/storage_rpc/v1') {
try { try {
const bodyObject = JSON.parse(body); const bodyObject = JSON.parse(body);
if (bodyObject.method !== 'store') { if (bodyObject.method !== 'store') {

@ -74,7 +74,7 @@ describe('LocalLokiServer', () => {
}); });
try { try {
await axios.post('http://localhost:8001/v1/storage_rpc', messageData); await axios.post('http://localhost:8001/storage_rpc/v1', messageData);
} catch (error) { } catch (error) {
assert.isNotOk(error, 'Error occured'); assert.isNotOk(error, 'Error occured');
} }

Loading…
Cancel
Save