Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add https to yarn run?

I am trying to run a yarn server with

$ yarn run start --https

which starts a server, but with http not https. The --https option works for another project that I was working on, but not this one. I was wondering if I need to set something in package.json as well to enable https. For reference, this is the github project that I cloned and am using: https://github.com/googlecreativelab/teachable-machine-boilerplate.

like image 203
scottlittle Avatar asked Nov 04 '25 04:11

scottlittle


2 Answers

The boilerplate uses a development server budo, so yarn start essentially runs budo dist. You can still pass options to it.

budo has no https option, but it does have an --ssl option for this purpose.

yarn start --ssl
like image 125
Explosion Pills Avatar answered Nov 05 '25 23:11

Explosion Pills


Explained on docs:

    HTTPS=true npm start

or set it on scripts section of your package.json:

    {
      "start": "HTTPS=true react-scripts start"
    }
like image 37
roj4s Avatar answered Nov 06 '25 01:11

roj4s