IPFS Middleware
Server ipfs objects from /ipfs/
on a server through the API
interface.
By default only objects are served and actual api access is disabled. See other options at the end to enable the API.
If you wish to simply serve static files through the ipfs gateway I guess you guys proxy-middleware
Install
npm install ipfs-node-server-static
Currently only allows no mount point for express
Express
var ipfs_static = 'localhost' 5001 var express = var app = app app var server = app
Stock Http
var ipfs_static = 'localhost' 5001 var http = var server = http
Other options
API
By default ipfs-node-server-static
uses the api to fullfil requests. You
can enable the pass of /api/
as well by passing true to the api
option.
var ipfs_static = require('./')('localhost', 5001, {api: true})