easy-local-ssl
v1.0.0
Published
Easily generate a self signed SSL for local development
Downloads
1
Maintainers
Readme
easy-local-ssl
Automatic self signed SSL generation for local development (MacOS/Windows).
Powered by devcert.
Install
npm install --save easy-local-ssl
Examples
Check out the examples folder:
Usage
const generateSslCert = require("easy-local-ssl");
// in your webpack config
const ssl = await generateSslCert();
...
// https://webpack.js.org/configuration/dev-server/#devserverhttps
devServerConfig.https = {
key: ssl.key,
cert: ssl.cert,
};
Advanced Usage
The generateSslCert method accepts an options
object.
| Property | Description | Default value | Type |
| ----------------- | ---------------------------------------------------- | ------------- | ------- |
| domain
| custom domain for the auto generated ssl certificate | "localhost" | string |
| modifyHostsFile
| modifying your /etc/hosts file for custom domains? | true | boolean |
// specify a custom domain
const ssl = await generateSslCert({
domain: "local.myapp.com",
modifyHostsFile: true
});
License
MIT © patricktran