Skip to content

Commit 1e17e63

Browse files
Drop convenience for dealing with types
1 parent 180160a commit 1e17e63

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/Node/Http2/Server.purs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module Node.Http2.Server
22
( toTlsServer
33
, createSecureServer
4-
, createSecureServer'
54
, checkContinueHandle
65
, requestHandle
76
, sessionHandle
@@ -24,39 +23,21 @@ import Node.EventEmitter (EventHandle(..))
2423
import Node.EventEmitter.UtilTypes (EventHandle1, EventHandle2, EventHandle4, EventHandle0)
2524
import Node.Http2.Flags (BitwiseFlag)
2625
import Node.Http2.Types (Headers, Http2CreateSecureServerOptions, Http2SecureServer, Http2ServerRequest, Http2ServerResponse, Http2Session, Http2Stream, Settings)
27-
import Node.Net.Types (NewServerOptions, TCP)
28-
import Node.Net.Types as NetTypes
26+
import Node.Net.Types (NewServerOptions)
2927
import Node.Stream (Duplex)
30-
import Node.TLS.Server as TlsServer
3128
import Node.TLS.Types (CreateSecureContextOptions, Server, TlsCreateServerOptions, TlsServer)
3229
import Prim.Row as Row
3330
import Unsafe.Coerce (unsafeCoerce)
3431

3532
toTlsServer :: Http2SecureServer -> TlsServer
3633
toTlsServer = unsafeCoerce
3734

38-
-- | Same as `createSecureServer` but provides the value as each of its subclasses via record syntax
39-
-- | for ease of use.
4035
createSecureServer
41-
:: forall rec trash
42-
. Row.Union rec trash (Http2CreateSecureServerOptions (TlsCreateServerOptions Server (CreateSecureContextOptions (NewServerOptions ()))))
43-
=> { | rec }
44-
-> Effect { http2 :: Http2SecureServer, tls :: TlsServer, net :: NetTypes.Server TCP }
45-
createSecureServer options = (runEffectFn1 createSecureServerImpl options) <#> \http2 -> do
46-
let
47-
tls = toTlsServer http2
48-
net = TlsServer.toNetServer tls
49-
{ http2
50-
, tls
51-
, net
52-
}
53-
54-
createSecureServer'
5536
:: forall rec trash
5637
. Row.Union rec trash (Http2CreateSecureServerOptions (TlsCreateServerOptions Server (CreateSecureContextOptions (NewServerOptions ()))))
5738
=> { | rec }
5839
-> Effect Http2SecureServer
59-
createSecureServer' options = runEffectFn1 createSecureServerImpl options
40+
createSecureServer options = runEffectFn1 createSecureServerImpl options
6041

6142
foreign import createSecureServerImpl :: forall r. EffectFn1 { | r } (Http2SecureServer)
6243

0 commit comments

Comments
 (0)