Observed since 20 Oct, 20:08 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
4finance-redirect-url
Implements express middleware for redirections
Redirect URL is an express middleware for redirection with slashes at the end of the URL path and for redirecting old urls by new ones.
Old to new URL redirections should be used in older projects where contentful redirections are not present.
yarn add 4finance-redirect-url
We would like to be able to use an unified workflow for redirections.
To use Redirect URL you need just to import fillSlash and redirect to use it as an express middleware. For client side, import withSlashes and wrap router history with that.
client.js
...
import { withSlashes } from '4finance-redirect-url';
const appHistory = withSlashes(useRouterHistory(createBrowserHistory)());
...
server.js
...
import { fillSlash, redirect } from '4finance-redirect-url'
const redirections = {
'/old-url/': '/new-url/',
};
const app = express();
app.use(redirect(redirections));
app.use(fillSlash);
...
0.2.1 - Fix not sending next after redirect 0.2.0 - Add fillSlashWithIgnore method for adding slashes at the end of the url but keep url from ignore list without change
0.1.1 - Fix path in redirection 0.1.0 - Add support for client side slash inserting
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
uri-jsEnvironment{
"local_name": "uri-js",
"alias": false,
"peer_metadata": null
} | ^3.0.2 | runtime |
Source distribution
{
"shasum": "c1485647d14896624947e4eb60ecef9c5c3f9cf6",
"tarball": "https://registry.npmjs.org/4finance-redirect-url/-/4finance-redirect-url-0.0.1.tgz",
"integrity": "sha512-Q+Xa8lESwMdNQdQXDVeANMGYtlw2+a/s52t7MA2whLNjLaCj0/8+ftRx6+qGyW8Gp8lSlkS2a8s4Lv7XghFg8g==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQCyCJmc/dfcZyFM8shSy226H9lZn8vlyoBCGOknYJKVKwIhALy2p78Cp3szH79+TgJhOqr4MQWarRNSEQdOHIytKUQc"
}
]
}Observed since 20 Oct, 20:08 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:fa27d81306e8cf40af67094580606e153e12bdbbdce1b392ef2e67ab9344edb8