create-react-app: how to use https instead of http?

后端 未结 19 1315
眼角桃花
眼角桃花 2020-12-24 10:04

I was wondering if anyone knows how to use https on dev for the \'create-react-app\' environment. I can\'t see anything about that in the README or quick googling. I just wa

19条回答
  •  不思量自难忘°
    2020-12-24 11:10

    In Windows environment add following lines to package.json:

      "scripts": {
        "start-dev": "set HTTPS=true&&set PORT=443&&react-scripts start"
      },
    

    It will start development server with https and port 443. At the present moment NodeJs have known bug to run this correctly but it worked with nodeJs v8.11.3 - https://nodejs.org/dist/v8.11.3/node-v8.11.3-x64.msi for me.

提交回复
热议问题