0.1.5 • Published 8 months ago

next-ssl-redirect-middleware v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

next-ssl-redirect-middleware

Nextjs Middleware to redirect http to https. This is helpful if you are hosting your site on a service that doesn't have "force ssl" support out of the box (IE: heroku).

Install

npm i -S next-ssl-redirect-middleware

Usage

Create a file middleware.ts (or .js) with the following:

import sslRedirect from 'next-ssl-redirect-middleware';

export default sslRedirect({});

Options:

  • environments: List of NODE_ENV to run this middleware for. Defaults ['production']

  • status: The status code to redirect with. defaults to 301

Credits

paulomcnally/node-heroku-ssl-redirect was referenced heavily in the creation of this library.

0.1.5

8 months ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago