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

Add WebUI Path #1124

Merged
merged 2 commits into from
Dec 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/http/api/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ module.exports = (server) => {
require('./files')(server)
require('./pubsub')(server)
require('./debug')(server)
require('./webui')(server)
}
25 changes: 25 additions & 0 deletions src/http/api/routes/webui.js
Original file line number Diff line number Diff line change
@@ -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');
}
}
])
}