diff --git a/src/HTTPurple/Server.purs b/src/HTTPurple/Server.purs index 00f3d10..b177e27 100644 --- a/src/HTTPurple/Server.purs +++ b/src/HTTPurple/Server.purs @@ -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) -> diff --git a/test/Test/HTTPurple/ServerSpec.purs b/test/Test/HTTPurple/ServerSpec.purs index f526479..ccfeabe 100644 --- a/test/Test/HTTPurple/ServerSpec.purs +++ b/test/Test/HTTPurple/ServerSpec.purs @@ -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) diff --git a/test/Test/HTTPurple/TestHelpers.purs b/test/Test/HTTPurple/TestHelpers.purs index 7cdcc83..f67721e 100644 --- a/test/Test/HTTPurple/TestHelpers.purs +++ b/test/Test/HTTPurple/TestHelpers.purs @@ -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) @@ -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) @@ -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