rumkin / plant

🌳 JS web server charged with WebAPI and neat HTTP2 support
https://npmjs.com/package/@plant/plant
81 stars 6 forks source link

Rework HTTPS creation interface #22

Open rumkin opened 4 years ago

rumkin commented 4 years ago

According to the #21 issue, there is some confusion between Node.js interfaces so it requires research and probably rework current interfaces.

Thoughts

  1. Current Node.js createSecureServer method for HTTP2 could be designed as more protected version while it's not. Developers could misinterpret the meaning of "secure" here, so it's better to rename this method into createEncryptedServer.
  2. Packages http and https could be merged into one and expose methods: createServer and createEncryptedServer, as like as http2 and https2.