diff --git a/src/Node/HTTP/Secure.purs b/src/Node/HTTP/Secure.purs index 66fe288..7c5a14e 100644 --- a/src/Node/HTTP/Secure.purs +++ b/src/Node/HTTP/Secure.purs @@ -88,6 +88,22 @@ import Node.Buffer (Buffer) import Node.HTTP (Request, Response, Server, HTTP) import Unsafe.Coerce (unsafeCoerce) +-- | Create an HTTPS server, given the SSL options and a function to be executed +-- | when a request is received. +foreign import createServerImpl :: + forall eff. + Foreign -> + (Request -> Response -> Eff (http :: HTTP | eff) Unit) -> + Eff (http :: HTTP | eff) Server + +-- | Create an HTTPS server, given the SSL options and a function to be executed +-- | when a request is received. +createServer :: forall eff. + Options SSLOptions -> + (Request -> Response -> Eff (http :: HTTP | eff) Unit) -> + Eff (http :: HTTP | eff) Server +createServer = createServerImpl <<< options + -- | The type of HTTPS server options data SSLOptions @@ -264,19 +280,3 @@ secureOptions = opt "secureOptions" -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) sessionIdContext :: Option SSLOptions String sessionIdContext = opt "sessionIdContext" - --- | Create an HTTPS server, given the SSL options and a function to be executed --- | when a request is received. -foreign import createServerImpl :: - forall eff. - Foreign -> - (Request -> Response -> Eff (http :: HTTP | eff) Unit) -> - Eff (http :: HTTP | eff) Server - --- | Create an HTTPS server, given the SSL options and a function to be executed --- | when a request is received. -createServer :: forall eff. - Options SSLOptions -> - (Request -> Response -> Eff (http :: HTTP | eff) Unit) -> - Eff (http :: HTTP | eff) Server -createServer = createServerImpl <<< options