Skip to content

Move important functions first #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/Node/HTTP/Secure.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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