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

后端 未结 19 1287
眼角桃花
眼角桃花 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 10:45

    You can edit your package.json scripts section to read:

    "scripts": { "start": "set HTTPS=true&&react-scripts start", ... }

    or just run set HTTPS=true&&npm start

    Just a sidenote, for me, making this change breaks hot reloading for some reason....

    -- Note: OS === Windows 10 64-Bit

提交回复
热议问题