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

后端 未结 19 1288
眼角桃花
眼角桃花 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

    You can also create a file called .env in the root of your project, then write

    HTTPS=true
    

    After that, just run "npm start" as you usually do to start your app.

    Docs: https://facebook.github.io/create-react-app/docs/advanced-configuration

    Works both on Linux and Windows, unlike some other answers posted here.

提交回复
热议问题