From 4af0aa4a3d38a81a0a4721674bcc0dd8cc4bc24b Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 2 Dec 2017 15:04:07 +0000 Subject: [PATCH 1/2] Create webui.js --- src/http/api/routes/webui.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/http/api/routes/webui.js diff --git a/src/http/api/routes/webui.js b/src/http/api/routes/webui.js new file mode 100644 index 0000000000..9d0fc7a625 --- /dev/null +++ b/src/http/api/routes/webui.js @@ -0,0 +1,25 @@ +const resources = require('../../gateway/resources') + +module.exports = (server) => { + const gateway = server.select('API') + + gateway.route([ + { + method: '*', + path: '/ipfs/{cid*}', + config: { + pre: [ + { method: resources.gateway.checkCID, assign: 'args' } + ], + handler: resources.gateway.handler + } + }, + { + method: '*', + path: '/webui', + handler: (request, reply) => { + return reply().redirect().location('/ipfs/QmQLXHs7K98JNQdWrBB2cQLJahPhmupbDjRuH1b9ibmwVa'); + } + } + ]) +} From 021b939b995e01ea1123479057d5a8aead738036 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 2 Dec 2017 15:04:37 +0000 Subject: [PATCH 2/2] Update index.js --- src/http/api/routes/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http/api/routes/index.js b/src/http/api/routes/index.js index 3fa1d75e68..08756fc91c 100644 --- a/src/http/api/routes/index.js +++ b/src/http/api/routes/index.js @@ -14,4 +14,5 @@ module.exports = (server) => { require('./files')(server) require('./pubsub')(server) require('./debug')(server) + require('./webui')(server) }