Enable TLS/SSL

To run the server over HTTPS, you need to set the https configuration property. Internally, the https options are passed as first argument to node's https.createServer(...) function. More details can be found [here][https-package-createServer-url].

The example below assumes you have server.key private key file and server.crt publlic certificate file in the root of your project.

// config/production.js
import fs from 'fs';
export default {
    ...
    https: {
        key: fs.readFileSync('server.key'),
        cert: fs.readFileSync('server.crt') 
    },
    ...
}

results matching ""

    No results matching ""