jhudson8 / smocks-magellan-nightwatch

Adapter for Magellan nightwatch to support the smocks stateful mock server
MIT License
2 stars 2 forks source link

Adding support for starting https server #3

Open pranavparikh opened 8 years ago

pranavparikh commented 8 years ago

@jhudson8

jhudson8 commented 8 years ago

@pranavparikh I'd like for this to remain backwards compatible. Can you use the abstraction layer already in place to create an https implementation and allow a config parameter to define which implementation to use.

So, the http implementation is https://github.com/jhudson8/smocks-magellan-nightwatch/blob/master/lib/nightwatch-mocks-handler.js (prob want to rename to nightwatch-mocks-http-handler)

The implementation is imported here: https://github.com/jhudson8/smocks-magellan-nightwatch/blob/master/lib/nightwatch-handler.js#L6

All you need to do is create a separate impl for https and lazy load that impl based on a config param. Make sense? It will be much cleaner that way.

jhudson8 commented 8 years ago

as we discussed offline. Refactor to use a single HAPI instance with 2 connections to support http/https on a single port.