简体   繁体   中英

create react app how to serve it over https?

Could someone point me to a link for total beginners as to how to set up https using create react app?

I've ejected the app and need to modify webpack I think. But then I don't know where to go from there.

I have self-signed certificates generated already.

Thank you

You dont need to modify your webpack or eject the app to use https

If you want to use Https in development you'll need to set the environment veriable HTTPS=true in your start script in package.json

HTTPS=true npm start

read about it here

If you want to host it on something like amazon S3 you can use cloudfront

https://medium.com/@omgwtfmarc/deploying-create-react-app-to-s3-or-cloudfront-48dae4ce0af

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM