generator icon indicating copy to clipboard operation
generator copied to clipboard

Add https option

Open oscl opened this issue 7 years ago • 8 comments

Hi Dev, Today, I was going to create an Express based website on my cloud account. I knew that the providers also provides free SSL for my websites. So, after deployment, I tried to visit my website using https(https://my domain.tld) but the server says that they can't provide secure connection and returns invalid response. Because the server is actually started for http protocol. When I searched about it on Google, everyone says that I have to edit the www file using a text editors manually. If I have to do things manually, then what is the job of Express generator ?

If the Dev team could add a flag like --https then we could use something like Express --view=ejs --https and it'll be more awesome!

oscl avatar Jun 17 '18 03:06 oscl

Pull requests welcome to add the feature :+1:

dougwilson avatar Jun 17 '18 03:06 dougwilson

Sorry but I'm not familiar with familiar with GitHub and pull requests that much. If I need to do anything else in GitHub for that feature, can you do it for me?

oscl avatar Jun 17 '18 04:06 oscl

I'm not sure I understand your question. As for making a pull request, this project is open source and contains what was contributed. You're welcome to contribute the feature you're looking for, but if you're not sure how or have the time, you're welcome to find someone else who has the time / skills to get it added 👍

dougwilson avatar Jun 17 '18 04:06 dougwilson

I'm not that much well learnt. If anyone could add that awesome feature, I'll describe the thing for them.

Normally, when we start a project by generating Express using command like express --view=ejs, It just simply creates an Express app in the folder with ejs chosen as view engine. I'm not talking about EJS okay... But the problem is that if express-generator users install Express on a cloud computing server (which server a subdomain for him with https enabled), then he can surely visit the newly created website using address like http://sub.domain.com but not https://sub.domain.com because codes from www.js are creating Web server for only http. Not for https.

If Express generator has another feature like an https flag, Express-generator user could simply run a command like Express --view=ejs --https for generating Express files with the code of https enabled server.

Please.... If anybody could add this feature, add it. Please..

oscl avatar Jun 18 '18 11:06 oscl

@dougwilson I've created a PR for the issue, can you check please? thanks

jonnyka avatar Jun 19 '18 14:06 jonnyka

My suggestion is to NOT add this feature.

  • HTTPS is supposed to be handled by a web-server like NGINX
  • OR the elastic load balancer
  • The application should keep itself free of attaching PEM certificates and stuff

slidenerd avatar Aug 17 '19 10:08 slidenerd

Your question was answered. Sorta. https://help.dreamhost.com/hc/en-us/articles/215747758-Force-your-site-to-load-securely-with-an-htaccess-file

kingadimu avatar May 11 '20 17:05 kingadimu

We could allow the user choose an https option through the command line then the application(express-generator) Could generate an SSL certificate if https option was chosen.

oviecodes avatar Nov 08 '20 11:11 oviecodes