Catalog npm
Back to packageRELEASE DETAILS

0.0.1

npm

4finance-redirect-url

Implements express middleware for redirections

redirecturiurl
Published9 May 2017
Direct dependencies1
Transitive dependenciesNot calculated

README

Current package documentation

Redirect URL

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

Motivation

We would like to be able to use an unified workflow for redirections.

How to use

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.

Example

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);
...

Changelog

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.2.*

0.1.1 - Fix path in redirection 0.1.0 - Add support for client side slash inserting

0.1.*

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
uri-js
Environment
{
  "local_name": "uri-js",
  "alias": false,
  "peer_metadata": null
}
^3.0.2runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "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"
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:fa27d81306e8cf40af67094580606e153e12bdbbdce1b392ef2e67ab9344edb8

Other collected versions

0.2.116 May0.2.016 May0.1.116 May0.1.010 MayView all collected versions →