express-promisified

1.0.10 • Public • Published

express-promisified

Express with promises

HTTPS Support

  1. Create a .crt and .key in the app using this module
openssl genrsa 2048 > localhost.key
chmod 400 localhost.key
openssl req -new -x509 -nodes -sha256 -days 365 -key localhost.key -out localhost.crt
  1. Press enter through all fields
Country Name (2 letter code) []:
State or Province Name (full name) []:
Locality Name (eg, city) []:
Organization Name (eg, company) []:
Organizational Unit Name (eg, section) []:
Common Name (eg, fully qualified host name) []:
Email Address []:
  1. When calling listenHTTPS you will need to pass the cert and key
import fs from 'fs';
// const fs = require(fs);

...

const port = process.env.PORT
    ? parseInt(process.env.PORT, 10)
    : 8443;
const privateKey = fs.readFileSync('./creds/localhost.key');
const certificate = fs.readFileSync('./creds/localhost.crt');

...

server.listenHTTPS({ port, privateKey, certificate })

Readme

Keywords

Package Sidebar

Install

npm i express-promisified

Weekly Downloads

11

Version

1.0.10

License

Apache-2.0

Unpacked Size

22.6 kB

Total Files

10

Last publish

Collaborators

  • bluepnume