Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ipfs-node-server-static
Advanced tools
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 = require('./')('localhost', 5001)
var express = require('express')
var app = express()
app.use(ipfs_static)
app.get('/', function (req, res) {
res.send('Hello World!')
})
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
console.log('Example app listening at http://%s:%s', host, port)
})
Stock Http
var ipfs_static = require('./')('localhost', 5001)
var http = require('http')
var server = http.Server(function (req, res) {
var send404 = (function() {
return function send404() {
res.writeHead(404)
res.end()
}
})()
ipfs_static(req, res, send404)
}).listen(3000, function () {
var host = server.address().address
var port = server.address().port
console.log('Example app listening at http://%s:%s', host, port)
})
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})
FAQs
Static file server middleware for ipfs
We found that ipfs-node-server-static demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.