Nutritious Pumpkin Mash

    force-secure-express

    1.0.1 • Public • Published

    Force Secure Express

    Travis Build Codecov npm downloads

    Description

    Express middleware to redirect insecure http requests to https.

    Install

    npm install force-secure-express --save

    Usage

    const forceSecure = require("force-secure-express");
    const express = require("express");
    const app = express();
     
    const port = Number(process.env.PORT) || 3000;
     
    app.use(forceSecure([
        "example.com",
        "staging.example.com"
    ]));
     
    app.use(express.static("./public"));
     
    app.get("*", (req, res) => {
      res.sendFile("./public/index.html")
    });
     
    app.listen(port, () => {
      logger.info(`${port} we have liftoff \u{1F680}`)
    });

    Install

    npm i force-secure-express

    DownloadsWeekly Downloads

    71

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    6.88 kB

    Total Files

    14

    Last publish

    Collaborators

    • rphansen91