@@ -9,20 +9,21 @@ const favicon = require('ipfs-registry-mirror-common/handlers/favicon')
99const root = require ( '../handlers/root' )
1010const tarball = require ( '../handlers/tarball' )
1111const manifest = require ( '../handlers/manifest' )
12+ const getIpfs = require ( '../middlewares/getIpfs' )
1213
13- const startServer = ( config , ipfs ) => {
14+ const startServer = ( config ) => {
1415 const app = express ( )
1516
1617 app . use ( requestLog )
1718
18- app . get ( '/favicon.ico' , favicon ( config , ipfs , app ) )
19- app . get ( '/favicon.png' , favicon ( config , ipfs , app ) )
19+ app . get ( '/favicon.ico' , favicon ( config , app ) )
20+ app . get ( '/favicon.png' , favicon ( config , app ) )
2021
21- app . get ( '/' , root ( config , ipfs , app ) )
22+ app . get ( '/' , getIpfs ( config ) , root ( config , app ) )
2223
2324 // intercept requests for tarballs and manifests
24- app . get ( '/*.tgz' , tarball ( config , ipfs , app ) )
25- app . get ( '/*' , manifest ( config , ipfs , app ) )
25+ app . get ( '/*.tgz' , getIpfs ( config ) , tarball ( config , app ) )
26+ app . get ( '/*' , getIpfs ( config ) , manifest ( config , app ) )
2627
2728 // everything else should just proxy for the registry
2829 const registry = proxy ( config . registry , {
@@ -35,9 +36,7 @@ const startServer = (config, ipfs) => {
3536
3637 app . use ( errorLog )
3738
38- app . locals . ipfs = ipfs
39-
40- return new Promise ( async ( resolve , reject ) => {
39+ return new Promise ( ( resolve , reject ) => {
4140 const callback = once ( ( error ) => {
4241 if ( error ) {
4342 reject ( error )
0 commit comments