Skip to content
No description, website, or topics provided.
JavaScript TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig
.gitignore
.travis.yml
README.md
package.json
plugin.d.ts
plugin.js
tsconfig.json

README.md

fastify-https-redirect

A plugin for Fastify that adds support for http => https redirects.

Example

npm install fastify-https-redirect
const server = Fastify({
    http2: true,
    https: {
      allowHTTP1: true,
      key: fs.readFileSync(path.resolve(__dirname, './yourSSL.key')),
      cert: fs.readFileSync(path.resolve(__dirname, './yourSSL.cert')),
    },
  });
server.register(httpsRedirect);

With custom http Port

const server = Fastify({
    http2: true,
    https: {
      allowHTTP1: true,
      key: fs.readFileSync(path.resolve(__dirname, './yourSSL.key')),
      cert: fs.readFileSync(path.resolve(__dirname, './yourSSL.cert')),
    },
  });
server.register(httpsRedirect,{httpPort:1080});

License

MIT License

You can’t perform that action at this time.