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

Commit

Permalink
chore: integrate http response module (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored and alanshaw committed Jun 18, 2018
1 parent cd449ff commit ddd9849
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 215 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"ipfs-bitswap": "~0.20.0",
"ipfs-block": "~0.7.1",
"ipfs-block-service": "~0.14.0",
"ipfs-http-response": "^0.1.2",
"ipfs-multipart": "~0.1.0",
"ipfs-repo": "~0.22.1",
"ipfs-unixfs": "~0.1.14",
Expand Down
86 changes: 0 additions & 86 deletions src/http/gateway/dir-view/index.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/http/gateway/dir-view/style.js

This file was deleted.

110 changes: 0 additions & 110 deletions src/http/gateway/resolver.js

This file was deleted.

6 changes: 3 additions & 3 deletions src/http/gateway/resources/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const fileType = require('file-type')
const mime = require('mime-types')
const Stream = require('readable-stream')

const gatewayResolver = require('../resolver')
const { resolver } = require('ipfs-http-response')
const PathUtils = require('../utils/path')

module.exports = {
Expand Down Expand Up @@ -37,7 +37,7 @@ module.exports = {
// switch case with true feels so wrong.
switch (true) {
case (errorToString === 'Error: This dag node is a directory'):
gatewayResolver.resolveDirectory(ipfs, ref, err.fileName, (err, data) => {
resolver.directory(ipfs, ref, err.fileName, (err, data) => {
if (err) {
log.error(err)
return reply(err.toString()).code(500)
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = {
}
}

return gatewayResolver.resolveMultihash(ipfs, ref, (err, data) => {
return resolver.multihash(ipfs, ref, (err, data) => {
if (err) {
return handleGatewayResolverError(err)
}
Expand Down

0 comments on commit ddd9849

Please sign in to comment.