Socket
Book a DemoInstallSign in
Socket

@abernier/redirect

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abernier/redirect

Connect/Express ?redirect middleware

1.0.7
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

ci/cd NPM version Coverage Status

Connect/Express ?redirect middleware.

In short, it allows you to override any route/handler res.redirect('/foo') with a ?redirect=/bar querystring param.

Examples

Setup:

import express from 'express'
import redirect from '@abernier/redirect'

const app = express()
app.use(redirect())

Basic

app.post('/login', (req, res) => {
  // ...

  res.redirect('/profile') // default redirection
})

Override the default redirection -> be redirected to /welcomeback by adding a ?redirect querystring param:

$ curl -XPOST http://localhost:3000/login?redirect=/welcomeback

Publish to NPM

Ready to publish a new version to NPM registry?

Manually

  • bump the package.json version
  • npm login if not already
  • npm publish

If successful, you should want to tag the version:

$ git add package.json
$ git commit -m "bump version"
$ git tag v1.0.1
$ git push --tags

Using CI/CD workflow

Pre-requisite:

  • Generate a new NPM access token on npmjs.com (you need a NPM account and be logged-in)
  • Set it as NPM_TOKEN secret (in Settings > Secrets and as referenced into cicd.yml file)

Then, to release a new version on npm:

FAQs

Package last updated on 16 May 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.