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

chore: integrate http response module #1381

Merged
merged 1 commit into from
Jun 18, 2018
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 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.20.0",
"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