0

I run reactjs by serve on port 5000 after generating build. now I need SSL protocol. Is there any way to support serve on SSL?

serve -s build
Mohammad
  • 275
  • 1
  • 4
  • 10

1 Answers1

0

As far as I know React doesn't care what protocol http or https you are using. This is only about server configuration. However, you needed to be careful with the links used through your react components to be able to use https if needed. I guess you might be talking aboud nodejs or node. So, if this is the case this link might be helpful: https://www.sitepoint.com/how-to-use-ssltls-with-node-js/

Jose Cabrera Zuniga
  • 2,348
  • 3
  • 31
  • 56
  • I know about setting https on development build though, if you need any help with that. Do let me know. – Garry Jun 10 '19 at 15:45
  • @Garry Yes, I know that I can enable SSL by doing some change on react-script and webpack.But I couldn't do configuration.If I could do changing on production mood,It's done.If you help me I'll be thankfull, react version on package.json is: "react": "16.8.6" – Mohammad Jun 10 '19 at 17:01
  • @Mohammad Will this help? [how-can-i-provide-a-ssl-certificate-with-create-react-app](https://stackoverflow.com/questions/41192491/how-can-i-provide-a-ssl-certificate-with-create-react-app) – Matin Sasan Jun 10 '19 at 17:23
  • "start": "HTTPS=true react-scripts start" this one I am using it and its really easy to start with. – Garry Jun 10 '19 at 19:03
  • @MatinSasan The link is for webpack version 1 and I can't open it. In new version of reactjs, webpack is in react-script . and you should give me description based on that, so I'll understand . – Mohammad Jun 10 '19 at 19:47
  • @Garry I wanna introduce cert and key file so that my SSL is certificated – Mohammad Jun 10 '19 at 19:51