pnxtech / hydra-express

A module which wraps Hydra and ExpressJS into a library for building distributed applications - such as microservices
MIT License
184 stars 37 forks source link

https server implementation #121

Closed krysalead closed 6 years ago

krysalead commented 6 years ago

Hi,

This PR allows to create a HTTPS server with express Unit test is disabled because it needs to have certificat I can't commit to git.

Documentation

Activate HTTPS

{
 "hydra": {
   "serviceName": "echo-service",
   "serviceIP": "127.0.0.1",
   "servicePort": 3000,
   "serviceType": "",
   "serviceDescription": "",
   "serviceProtocol": "https",
   "sslKey": "client-key.pem",
   "sslCert": "client-cert.pem",
   "redis": {
     "url": "127.0.0.1",
     "port": 6379,
     "db": 1
   }
 }
}

That's all, it will register your server as secured to be called using https and start a server on the servicePort but accepting only encrypted requests.