0.5.1 • Published 6 years ago
express-https-app v0.5.1
Express HTTPS Helper
Creates and configures a minimal express app that automatically redirects HTTP to HTTPS and loads certificates.
Getting Started
// Get express instance and namespace
const { express, app } = require("express-https-app")();
// Routes
app.get('/', (req, res) => res.send('Hello Secure World!'));
Configure with environment variables
HTTP_PORT ( default: 8000 )
Port number to listen for HTTP requests.
HTTPS_PORT ( default: 8443 )
Port number to listen for HTTPS requests.
SSL_CERTIFICATE ( default: ssl/server.crt
)
Path to the ssl certificate file.
SSL_KEY ( default: ssl/server.key
)
Path to the ssl key file.