
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
express-seo-redirects
Advanced tools
Simple config based 301/302 redirects for express.
npm install express-seo-redirects --save
Add the middleware to your express application before all other routes.
var express = require('express');
var app = express();
var redirects = require('express-seo-redirects');
// add middleware with relative path to redirect.json file
app.use(redirects('./redirects.json'));
// standard express route
app.get('/', function(req, res) {
res.send('Hello world!');
});
Create a redirects.json
file in the root of your project, with a list of redirects:
[
{ "status": 301, "from": "/mobile-barcode-scanner", "to": "/docs/getting-started/mobile" },
{ "status": 301, "from": "/mobile-data-capture-platform", "to": "/" },
{ "status": 301, "from": "/plans", "to": "/pricing" },
{ "status": 301, "from": "/plans-new", "to": "/pricing" }
]
Each redirect can have 3 parameters:
Property | Type | Required | Description |
---|---|---|---|
from | string | :heavy_check_mark: | Relative URL of incoming request |
to | string | :heavy_check_mark: | Destination URL |
status | integer | HTTP response code (302 if not provided) |
QueryStrings are ignored by default, to match on path and query string pass app.use(redirects('./redirects.json', true));
as the second param to enable strict mode.
Feel free to contribute, either by raising an issue or:
git checkout -b my-new-feature
git commit -m 'Add some feature'
git push origin my-new-feature
For change-log, check releases.
Licensed under MIT License © John Doherty
FAQs
Simple config based 301/302 redirects for express
We found that express-seo-redirects 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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.