
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
mux-router
Advanced tools
Get the avaliable routes on your Micro Service Node App and import the same routes in other Gateway Node App.
It's a node module for Micro Services to get avaliable routes and import them in other Gateway App.
$ npm install --save mux-router
const express = require('express');
const { Router } = require('express');
const mux = require('mux-router').muxRouter;
const app = express();
const router = Router();
// The routes of your app
router.get('/users', function (req, res) {
res.send([{ name: 'Thor', email: 'thor@asgard.com' }]);
});
router.get('/clients', function (req, res) {
res.send([{ name: 'Tony Stark', email: 'tony@starkindustries.com' }]);
});
// Export your app routes using mux
// The routers of your app will be avaliable on http://localhost:3000/mux-router/routes
mux.generateRoutes([router]);
app.use('/', router);
// Set app to use routes of mux to create the route /mux-router/routes
app.use('/', mux.router);
app.listen(3000);
const express = require('express');
const mux = require('mux-router').muxRouter;
const app = express();
// Import the routes of other app to use
mux.generateRequests('http://localhost:3000', (req, res, next) => {
console.log('Redirecting to other app');
// Here you can choose to which url redirect the requests
mux.redirect('http://localhost:3000', req, res, next);
});
// Set app to use imported routes in other app using mux
app.use('/', mux.router);
app.listen(3001);
To run the test suite, first install the dependencies, then run npm run test:
$ npm install
$ npm run test
FAQs
Get the avaliable routes on your Micro Service Node App and import the same routes in other Gateway Node App.
We found that mux-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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.