Skip to content

Commit

Permalink
fix: tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
cakekindel authored and sigma-andex committed Sep 13, 2024
1 parent 8943576 commit 0534903
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/HTTPurple/Server.purs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ defaultMiddlewareErrorHandler err _ = do
internalServerError "Internal server error"

-- | handle requests without a routing adt.
handleRequestUnit :: forall m.
handleRequestUnit ::
forall m.
MonadError Error m =>
MonadAff m =>
(Request Unit -> m Response) ->
Expand Down
2 changes: 1 addition & 1 deletion test/Test/HTTPurple/ServerSpec.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Routing.Duplex (RouteDuplex')
import Routing.Duplex as RD
import Routing.Duplex.Generic as G
import Routing.Duplex.Generic as RG
import Test.HTTPurple.TestHelpers (Test, serveAwaitStarted, get, get', getStatus, (?=))
import Test.HTTPurple.TestHelpers (Test, get, get', getStatus, serveAwaitStarted, (?=))
import Test.Spec (describe, it)
import Test.Spec.Assertions (expectError)

Expand Down
10 changes: 5 additions & 5 deletions test/Test/HTTPurple/TestHelpers.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Data.Newtype (wrap)
import Data.String (toLower)
import Data.Tuple (Tuple)
import Effect (Effect)
import Effect.Aff (Aff, delay, makeAff, effectCanceler, nonCanceler)
import Effect.Aff (Aff, delay, effectCanceler, makeAff, nonCanceler)
import Effect.Aff.Compat (mkEffectFn1)
import Effect.Class (liftEffect)
import Effect.Console (log)
Expand All @@ -19,7 +19,7 @@ import Effect.Ref as Ref
import Foreign (Foreign)
import Foreign.Object (Object, lookup)
import Foreign.Object (empty, fromFoldable) as Object
import HTTPurple.Server (serve, ListenOptionsR, BasicRoutingSettings)
import HTTPurple.Server (BasicRoutingSettings, ListenOptionsR, serve)
import Justifill.Fillable (class FillableFields)
import Justifill.Justifiable (class JustifiableFields)
import Node.Buffer (Buffer, create, fromString)
Expand Down Expand Up @@ -125,9 +125,9 @@ request secure port' method' headers' path' body =
connectionAttemptFailedH = EventHandle "connectionAttemptFailed" mkEffectFn1

req # once_ HTTPClient.socketH
(\socket ->
once_ Stream.errorH (Left >>> done) (Socket.toDuplex socket)
*> once_ connectionAttemptFailedH (Left >>> done) socket
( \socket ->
once_ Stream.errorH (Left >>> done) (Socket.toDuplex socket)
*> once_ connectionAttemptFailedH (Left >>> done) socket
)
req # once_ HTTPClient.responseH (Right >>> done)
let stream = OM.toWriteable $ HTTPClient.toOutgoingMessage req
Expand Down

0 comments on commit 0534903

Please sign in to comment.