How i can start nwb in https?

360 Views Asked by At

I have this package.json script:

"scripts": {
    "build": "nwb build-react-component",
    "clean": "nwb clean-module && nwb clean-demo",
    "start": "nwb serve-react-demo --host 127.0.0.1 --port 3000",
    "test": "nwb test-react",
    "test:coverage": "nwb test-react --coverage",
    "test:watch": "nwb test-react --server"
  },

If i use npm start this rune me server at http://127.0.0.1:3000

How i can run https?

I try HTTPS=true npm start but its not working :(

Please help

2

There are 2 best solutions below

0
On

config in nwb.config.js

module.exports = { 
 devServer: {
  host: "sso-admin-presit.hktdc.com",
  port: 443,
  https: true   
 },
}
0
On

You can do this via devServer.https configuration, either in your nwb.config.js module…

{
  devServer: {
    https: true
  }
}

…or via the CLI:

nwb serve-react-demo --devServer.https