Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 8041b48

Browse files
hacdiasdaviddias
authored andcommittedDec 2, 2017
feat: add WebUI Path (#1124)
* Create webui.js * Update index.js
1 parent 776696f commit 8041b48

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
 

‎src/http/api/routes/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ module.exports = (server) => {
1414
require('./files')(server)
1515
require('./pubsub')(server)
1616
require('./debug')(server)
17+
require('./webui')(server)
1718
}

‎src/http/api/routes/webui.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const resources = require('../../gateway/resources')
2+
3+
module.exports = (server) => {
4+
const gateway = server.select('API')
5+
6+
gateway.route([
7+
{
8+
method: '*',
9+
path: '/ipfs/{cid*}',
10+
config: {
11+
pre: [
12+
{ method: resources.gateway.checkCID, assign: 'args' }
13+
],
14+
handler: resources.gateway.handler
15+
}
16+
},
17+
{
18+
method: '*',
19+
path: '/webui',
20+
handler: (request, reply) => {
21+
return reply().redirect().location('/ipfs/QmQLXHs7K98JNQdWrBB2cQLJahPhmupbDjRuH1b9ibmwVa');
22+
}
23+
}
24+
])
25+
}

0 commit comments

Comments
 (0)
This repository has been archived.