@@ -88,6 +88,22 @@ import Node.Buffer (Buffer)
88
88
import Node.HTTP (Request , Response , Server , HTTP )
89
89
import Unsafe.Coerce (unsafeCoerce )
90
90
91
+ -- | Create an HTTPS server, given the SSL options and a function to be executed
92
+ -- | when a request is received.
93
+ foreign import createServerImpl ::
94
+ forall eff .
95
+ Foreign ->
96
+ (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
97
+ Eff (http :: HTTP | eff ) Server
98
+
99
+ -- | Create an HTTPS server, given the SSL options and a function to be executed
100
+ -- | when a request is received.
101
+ createServer :: forall eff .
102
+ Options SSLOptions ->
103
+ (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
104
+ Eff (http :: HTTP | eff ) Server
105
+ createServer = createServerImpl <<< options
106
+
91
107
-- | The type of HTTPS server options
92
108
data SSLOptions
93
109
@@ -264,19 +280,3 @@ secureOptions = opt "secureOptions"
264
280
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
265
281
sessionIdContext :: Option SSLOptions String
266
282
sessionIdContext = opt " sessionIdContext"
267
-
268
- -- | Create an HTTPS server, given the SSL options and a function to be executed
269
- -- | when a request is received.
270
- foreign import createServerImpl ::
271
- forall eff .
272
- Foreign ->
273
- (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
274
- Eff (http :: HTTP | eff ) Server
275
-
276
- -- | Create an HTTPS server, given the SSL options and a function to be executed
277
- -- | when a request is received.
278
- createServer :: forall eff .
279
- Options SSLOptions ->
280
- (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
281
- Eff (http :: HTTP | eff ) Server
282
- createServer = createServerImpl <<< options
0 commit comments