
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ipfs-react-router
Advanced tools
Better routing for IPFS websites when using React Router
An alternative to BrowserRouter or HashRouter in React Router that sets the basename (website root url path) dependent on how the site is being served over IPFS.
A site using the IpfsRouter can be served with working routing from all of the following:
Out of the box BrowserRouter will only allow one basename, forcing you to use HashRouter if you are intending to serve the site over an IPFS HTTP gateway. IpfsRouter scans the current url to establish which context it is being used in: domain root, IPFS over public gateway, IPNS over public gateway, then sets the basename accordingly.
npm install --save ipfs-react-router
React Router expects a top level Router component to provide access to the history API. IpfsRouter is a drop in replacement for BrowserRouter.
import React from 'react'
import { Route, Switch } from 'react-router-dom'
import IpfsRouter from 'ipfs-react-router'
function App() {
return (
<div className="App">
<IpfsRouter>
<Switch>
<Route exact path="/">
<h2>Homepage</h2>
</Route>
<Route path="/another">
<h2>Another</h2>
</Route>
<Route path="*">
<p>Not found</p>
</Route>
</Switch>
</IpfsRouter>
</div>
)
}
export default App
PRs accepted.
To run the tests (jest):
yarn test
Eslint and prettier are used for linting:
yarn lint
To auto-fix linting issues:
yarn lint:fix
MIT © John Kane
FAQs
React Router extension for IPFS style paths
We found that ipfs-react-router 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.