Skip to content

Commit

Permalink
feat: support unixfs dir-index-html listing (#576)
Browse files Browse the repository at this point in the history
Fixes #342
  • Loading branch information
SgtPooki authored Feb 12, 2025
1 parent b9d062e commit bcb6e1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@helia/http": "^2.0.3",
"@helia/interface": "^5.0.0",
"@helia/routers": "^3.0.0",
"@helia/verified-fetch": "^2.5.0",
"@helia/verified-fetch": "^2.5.1",
"@libp2p/crypto": "^5.0.11",
"@libp2p/dcutr": "^2.0.18",
"@libp2p/identify": "^3.0.18",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/get-verified-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createHeliaHTTP } from '@helia/http'
import { type BlockBroker } from '@helia/interface'
import { httpGatewayRouting, delegatedHTTPRouting, libp2pRouting } from '@helia/routers'
import { createVerifiedFetch, type VerifiedFetch } from '@helia/verified-fetch'
import { dirIndexHtmlPluginFactory } from '@helia/verified-fetch/plugins'
import { generateKeyPair } from '@libp2p/crypto/keys'
import { dcutr } from '@libp2p/dcutr'
import { identify, identifyPush } from '@libp2p/identify'
Expand Down Expand Up @@ -85,7 +86,7 @@ export async function getVerifiedFetch (config: ConfigDb, logger: ComponentLogge
})
}

return createVerifiedFetch(helia, { contentTypeParser, withServerTiming: true })
return createVerifiedFetch(helia, { contentTypeParser, withServerTiming: true, plugins: [dirIndexHtmlPluginFactory] })
}

type Libp2pDefaultsOptions = Pick<ConfigDb, 'routers' | 'enableWss' | 'enableWebTransport' | 'enableGatewayProviders'>
Expand Down

0 comments on commit bcb6e1f

Please sign in to comment.