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

Commit

Permalink
feat: add WebUI Path (#1124)
Browse files Browse the repository at this point in the history
* Create webui.js

* Update index.js
  • Loading branch information
hacdias authored and daviddias committed Dec 2, 2017
1 parent 776696f commit 8041b48
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
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');
}
}
])
}

0 comments on commit 8041b48

Please sign in to comment.