From c16eb2bdccc05b0302c8ab5bfa2f528fdb0bddf3 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Sun, 22 May 2022 12:47:58 +0100 Subject: [PATCH] Rename modules and rudimentarily update readme --- LICENSES/httpure.LICENSE | 20 ++++++++ License | 2 +- Readme.md | 17 ++----- docs/Examples/AsyncResponse/Main.purs | 2 +- docs/Examples/BinaryRequest/Main.purs | 2 +- docs/Examples/BinaryResponse/Main.purs | 2 +- docs/Examples/Chunked/Main.purs | 2 +- docs/Examples/CustomStack/Main.purs | 2 +- docs/Examples/Headers/Main.purs | 2 +- docs/Examples/HelloWorld/Main.purs | 2 +- docs/Examples/Middleware/Main.purs | 2 +- docs/Examples/MultiRoute/Main.purs | 2 +- docs/Examples/PathSegments/Main.purs | 4 +- docs/Examples/Post/Main.purs | 2 +- docs/Examples/QueryParameters/Main.purs | 2 +- docs/Examples/SSL/Main.purs | 2 +- src/HTTPure.purs | 46 +++++++++---------- src/{HTTPure => HTTPurple}/Body.purs | 6 +-- src/{HTTPure => HTTPurple}/Headers.purs | 4 +- src/{HTTPure => HTTPurple}/Lookup.purs | 2 +- src/{HTTPure => HTTPurple}/Method.purs | 4 +- src/{HTTPure => HTTPurple}/Path.purs | 4 +- src/{HTTPure => HTTPurple}/Query.purs | 4 +- src/{HTTPure => HTTPurple}/Request.purs | 30 ++++++------ src/{HTTPure => HTTPurple}/Response.purs | 18 ++++---- src/{HTTPure => HTTPurple}/Routes.purs | 6 +-- src/{HTTPure => HTTPurple}/Server.purs | 14 +++--- src/{HTTPure => HTTPurple}/Status.purs | 2 +- src/{HTTPure => HTTPurple}/Utils.purs | 2 +- src/{HTTPure => HTTPurple}/Version.purs | 4 +- .../Test/{HTTPure => HTTPurple}/BodySpec.purs | 8 ++-- .../{HTTPure => HTTPurple}/HeadersSpec.purs | 10 ++-- .../IntegrationSpec.purs | 4 +- .../{HTTPure => HTTPurple}/LookupSpec.purs | 6 +-- .../{HTTPure => HTTPurple}/MethodSpec.purs | 6 +-- .../Test/{HTTPure => HTTPurple}/PathSpec.purs | 6 +-- .../{HTTPure => HTTPurple}/QuerySpec.purs | 6 +-- .../{HTTPure => HTTPurple}/RequestSpec.purs | 14 +++--- .../{HTTPure => HTTPurple}/ResponseSpec.purs | 10 ++-- .../{HTTPure => HTTPurple}/ServerSpec.purs | 10 ++-- .../{HTTPure => HTTPurple}/StatusSpec.purs | 6 +-- .../{HTTPure => HTTPurple}/TestHelpers.js | 0 .../{HTTPure => HTTPurple}/TestHelpers.purs | 2 +- .../{HTTPure => HTTPurple}/UtilsSpec.purs | 6 +-- .../{HTTPure => HTTPurple}/VersionSpec.purs | 6 +-- test/Test/Main.purs | 30 ++++++------ 46 files changed, 178 insertions(+), 165 deletions(-) create mode 100644 LICENSES/httpure.LICENSE rename src/{HTTPure => HTTPurple}/Body.purs (98%) rename src/{HTTPure => HTTPurple}/Headers.purs (97%) rename src/{HTTPure => HTTPurple}/Lookup.purs (99%) rename src/{HTTPure => HTTPurple}/Method.purs (91%) rename src/{HTTPure => HTTPurple}/Path.purs (94%) rename src/{HTTPure => HTTPurple}/Query.purs (95%) rename src/{HTTPure => HTTPurple}/Request.purs (79%) rename src/{HTTPure => HTTPurple}/Response.purs (98%) rename src/{HTTPure => HTTPurple}/Routes.purs (90%) rename src/{HTTPure => HTTPurple}/Server.purs (93%) rename src/{HTTPure => HTTPurple}/Status.purs (99%) rename src/{HTTPure => HTTPurple}/Utils.purs (95%) rename src/{HTTPure => HTTPurple}/Version.purs (90%) rename test/Test/{HTTPure => HTTPurple}/BodySpec.purs (93%) rename test/Test/{HTTPure => HTTPurple}/HeadersSpec.purs (95%) rename test/Test/{HTTPure => HTTPurple}/IntegrationSpec.purs (98%) rename test/Test/{HTTPure => HTTPurple}/LookupSpec.purs (92%) rename test/Test/{HTTPure => HTTPurple}/MethodSpec.purs (90%) rename test/Test/{HTTPure => HTTPurple}/PathSpec.purs (90%) rename test/Test/{HTTPure => HTTPurple}/QuerySpec.purs (94%) rename test/Test/{HTTPure => HTTPurple}/RequestSpec.purs (91%) rename test/Test/{HTTPure => HTTPurple}/ResponseSpec.purs (94%) rename test/Test/{HTTPure => HTTPurple}/ServerSpec.purs (93%) rename test/Test/{HTTPure => HTTPurple}/StatusSpec.purs (72%) rename test/Test/{HTTPure => HTTPurple}/TestHelpers.js (100%) rename test/Test/{HTTPure => HTTPurple}/TestHelpers.purs (99%) rename test/Test/{HTTPure => HTTPurple}/UtilsSpec.purs (68%) rename test/Test/{HTTPure => HTTPurple}/VersionSpec.purs (93%) diff --git a/LICENSES/httpure.LICENSE b/LICENSES/httpure.LICENSE new file mode 100644 index 0000000..336123b --- /dev/null +++ b/LICENSES/httpure.LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Connor Prussin + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/License b/License index 336123b..dd1bd74 100644 --- a/License +++ b/License @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Connor Prussin +Copyright (c) 2022 Jan Schulte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/Readme.md b/Readme.md index 4f83705..f8ec2c3 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,6 @@ # HTTPurple 🪁 [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/sigma-andex/purescript-httpurple/main/License) -[![Latest release](http://img.shields.io/github/release/sigma-andex/purescript-httpurple.svg)](https://github.com/sigma-andex/purescript-httpurple/releases) -[![purescript-httpure on Pursuit](https://pursuit.purescript.org/packages/purescript-httpure/badge)](https://pursuit.purescript.org/packages/purescript-httpure) A 🎨 colourful fork of the amazing [HTTPure](https://github.com/citizennet/purescript-httpure) http server framework. @@ -10,7 +8,7 @@ A 🎨 colourful fork of the amazing [HTTPure](https://github.com/citizennet/pur ## Installation ```bash -spago install httpure +spago install httpurple ``` ## Quick Start @@ -21,7 +19,7 @@ module Main where import Prelude import Effect.Console (log) -import HTTPure (ServerM, serve, ok) +import HTTPurple (ServerM, serve, ok) main :: ServerM main = serve 8080 router $ log "Server now up on port 8080" @@ -31,18 +29,13 @@ main = serve 8080 router $ log "Server now up on port 8080" ## Documentation -Module documentation is published -on [Pursuit](http://pursuit.purescript.org/packages/purescript-httpure). - -You can also take a look at [our guides](./docs). +See the [docs folder](./docs). ## Examples -HTTPure ships with a number of [examples](./docs/Examples). To run an example, +HTTPurple ships with a number of [examples](./docs/Examples). To run an example, in the project root, run: -Or, without `nix`: - ```bash spago -x test.dhall run --main Examples..Main ``` @@ -60,4 +53,4 @@ spago -x test.dhall test ## License -[MIT](./License) +This is a fork of [HTTPure](https://github.com/citizennet/purescript-httpure), which is licensed under MIT. See the [original license](./LICENSES/httpure.LICENSE). This work is similarly licensed under [MIT](./License). diff --git a/docs/Examples/AsyncResponse/Main.purs b/docs/Examples/AsyncResponse/Main.purs index a7cafaa..4f52b35 100644 --- a/docs/Examples/AsyncResponse/Main.purs +++ b/docs/Examples/AsyncResponse/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, ok, serve) import Node.Encoding (Encoding(UTF8)) import Node.FS.Aff (readTextFile) import Routing.Duplex as RD diff --git a/docs/Examples/BinaryRequest/Main.purs b/docs/Examples/BinaryRequest/Main.purs index 1a42e21..8fd8aad 100644 --- a/docs/Examples/BinaryRequest/Main.purs +++ b/docs/Examples/BinaryRequest/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serve, toBuffer) +import HTTPurple (Request, ResponseM, ServerM, ok, serve, toBuffer) import Node.Buffer (Buffer) import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/BinaryResponse/Main.purs b/docs/Examples/BinaryResponse/Main.purs index 65e96e6..632fa9d 100644 --- a/docs/Examples/BinaryResponse/Main.purs +++ b/docs/Examples/BinaryResponse/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Headers, Request, ResponseM, ServerM, header, ok', serve) +import HTTPurple (Headers, Request, ResponseM, ServerM, header, ok', serve) import Node.FS.Aff (readFile) import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/Chunked/Main.purs b/docs/Examples/Chunked/Main.purs index ce8c232..dde78ed 100644 --- a/docs/Examples/Chunked/Main.purs +++ b/docs/Examples/Chunked/Main.purs @@ -7,7 +7,7 @@ import Data.Maybe (Maybe(..)) import Effect.Aff (Aff) import Effect.Class (liftEffect) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, ok, serve) import Node.ChildProcess (defaultSpawnOptions, spawn, stdout) import Node.Stream (Readable) import Routing.Duplex as RD diff --git a/docs/Examples/CustomStack/Main.purs b/docs/Examples/CustomStack/Main.purs index 9d48ff5..a88ecdb 100644 --- a/docs/Examples/CustomStack/Main.purs +++ b/docs/Examples/CustomStack/Main.purs @@ -8,7 +8,7 @@ import Data.Maybe (Maybe(..)) import Effect.Aff (Aff) import Effect.Aff.Class (class MonadAff) import Effect.Console (log) -import HTTPure (Request, Response, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, Response, ResponseM, ServerM, ok, serve) import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/Headers/Main.purs b/docs/Examples/Headers/Main.purs index a5c54d2..639c3a1 100644 --- a/docs/Examples/Headers/Main.purs +++ b/docs/Examples/Headers/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Headers, Request, ResponseM, ServerM, header, ok', serve, (!@)) +import HTTPurple (Headers, Request, ResponseM, ServerM, header, ok', serve, (!@)) import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/HelloWorld/Main.purs b/docs/Examples/HelloWorld/Main.purs index fb214b7..8acbfe7 100644 --- a/docs/Examples/HelloWorld/Main.purs +++ b/docs/Examples/HelloWorld/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (ServerM, ok, serve) +import HTTPurple (ServerM, ok, serve) import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/Middleware/Main.purs b/docs/Examples/Middleware/Main.purs index f8f62d3..ab938b7 100644 --- a/docs/Examples/Middleware/Main.purs +++ b/docs/Examples/Middleware/Main.purs @@ -7,7 +7,7 @@ import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Class (liftEffect) import Effect.Console (log) -import HTTPure (type (<+>), Request, ResponseM, ServerM, fullPath, header, ok, ok', serve, (<+>)) +import HTTPurple (type (<+>), Request, ResponseM, ServerM, fullPath, header, ok, ok', serve, (<+>)) import Record as Record import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/MultiRoute/Main.purs b/docs/Examples/MultiRoute/Main.purs index 2cf9cfd..7c8cc9c 100644 --- a/docs/Examples/MultiRoute/Main.purs +++ b/docs/Examples/MultiRoute/Main.purs @@ -5,7 +5,7 @@ import Prelude hiding ((/)) import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, ok, serve) import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as RG diff --git a/docs/Examples/PathSegments/Main.purs b/docs/Examples/PathSegments/Main.purs index fd64fa3..43e3f1e 100644 --- a/docs/Examples/PathSegments/Main.purs +++ b/docs/Examples/PathSegments/Main.purs @@ -5,8 +5,8 @@ import Prelude hiding ((/)) import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serve) -import HTTPure (Request, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, ok, serve) import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as G diff --git a/docs/Examples/Post/Main.purs b/docs/Examples/Post/Main.purs index abeb4da..7d6c81e 100644 --- a/docs/Examples/Post/Main.purs +++ b/docs/Examples/Post/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Method(Post), Request, ResponseM, ServerM, notFound, ok, serve, toString) +import HTTPurple (Method(Post), Request, ResponseM, ServerM, notFound, ok, serve, toString) import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as G diff --git a/docs/Examples/QueryParameters/Main.purs b/docs/Examples/QueryParameters/Main.purs index 34f076f..6c44947 100644 --- a/docs/Examples/QueryParameters/Main.purs +++ b/docs/Examples/QueryParameters/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Class.Console (log) -import HTTPure (Request, ResponseM, ServerM, notFound, ok, serve) +import HTTPurple (Request, ResponseM, ServerM, notFound, ok, serve) import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as G diff --git a/docs/Examples/SSL/Main.purs b/docs/Examples/SSL/Main.purs index fa37f5c..7ff57a7 100644 --- a/docs/Examples/SSL/Main.purs +++ b/docs/Examples/SSL/Main.purs @@ -5,7 +5,7 @@ import Prelude import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) import Effect.Console (log) -import HTTPure (Request, ResponseM, ServerM, ok, serveSecure) +import HTTPurple (Request, ResponseM, ServerM, ok, serveSecure) import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as G diff --git a/src/HTTPure.purs b/src/HTTPure.purs index 5c0ee7d..0616099 100644 --- a/src/HTTPure.purs +++ b/src/HTTPure.purs @@ -1,25 +1,25 @@ -module HTTPure - ( module HTTPure.Body - , module HTTPure.Headers - , module HTTPure.Lookup - , module HTTPure.Method - , module HTTPure.Path - , module HTTPure.Routes - , module HTTPure.Query - , module HTTPure.Request - , module HTTPure.Response - , module HTTPure.Server - , module HTTPure.Status +module HTTPurple + ( module HTTPurple.Body + , module HTTPurple.Headers + , module HTTPurple.Lookup + , module HTTPurple.Method + , module HTTPurple.Path + , module HTTPurple.Routes + , module HTTPurple.Query + , module HTTPurple.Request + , module HTTPurple.Response + , module HTTPurple.Server + , module HTTPurple.Status ) where -import HTTPure.Body (toBuffer, toStream, toString) -import HTTPure.Headers (Headers, empty, header, headers) -import HTTPure.Lookup (at, has, lookup, (!!), (!?), (!@)) -import HTTPure.Method (Method(..)) -import HTTPure.Path (Path) -import HTTPure.Query (Query) -import HTTPure.Request (Request, fullPath) -import HTTPure.Response (Response, ResponseM, accepted, accepted', alreadyReported, alreadyReported', badGateway, badGateway', badRequest, badRequest', conflict, conflict', continue, continue', created, created', emptyResponse, emptyResponse', expectationFailed, expectationFailed', failedDependency, failedDependency', forbidden, forbidden', found, found', gatewayTimeout, gatewayTimeout', gone, gone', hTTPVersionNotSupported, hTTPVersionNotSupported', iMUsed, iMUsed', imATeapot, imATeapot', insufficientStorage, insufficientStorage', internalServerError, internalServerError', lengthRequired, lengthRequired', locked, locked', loopDetected, loopDetected', methodNotAllowed, methodNotAllowed', misdirectedRequest, misdirectedRequest', movedPermanently, movedPermanently', multiStatus, multiStatus', multipleChoices, multipleChoices', networkAuthenticationRequired, networkAuthenticationRequired', noContent, noContent', nonAuthoritativeInformation, nonAuthoritativeInformation', notAcceptable, notAcceptable', notExtended, notExtended', notFound, notFound', notImplemented, notImplemented', notModified, notModified', ok, ok', partialContent, partialContent', payloadTooLarge, payloadTooLarge', paymentRequired, paymentRequired', permanentRedirect, permanentRedirect', preconditionFailed, preconditionFailed', preconditionRequired, preconditionRequired', processing, processing', proxyAuthenticationRequired, proxyAuthenticationRequired', rangeNotSatisfiable, rangeNotSatisfiable', requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge', requestTimeout, requestTimeout', resetContent, resetContent', response, response', seeOther, seeOther', serviceUnavailable, serviceUnavailable', switchingProtocols, switchingProtocols', temporaryRedirect, temporaryRedirect', tooManyRequests, tooManyRequests', uRITooLong, uRITooLong', unauthorized, unauthorized', unavailableForLegalReasons, unavailableForLegalReasons', unprocessableEntity, unprocessableEntity', unsupportedMediaType, unsupportedMediaType', upgradeRequired, upgradeRequired', useProxy, useProxy', variantAlsoNegotiates, variantAlsoNegotiates') -import HTTPure.Routes (type (<+>), combineRoutes, (<+>)) -import HTTPure.Server (ServerM, serve, serve', serveSecure, serveSecure') -import HTTPure.Status (Status) +import HTTPurple.Body (toBuffer, toStream, toString) +import HTTPurple.Headers (Headers, empty, header, headers) +import HTTPurple.Lookup (at, has, lookup, (!!), (!?), (!@)) +import HTTPurple.Method (Method(..)) +import HTTPurple.Path (Path) +import HTTPurple.Query (Query) +import HTTPurple.Request (Request, fullPath) +import HTTPurple.Response (Response, ResponseM, accepted, accepted', alreadyReported, alreadyReported', badGateway, badGateway', badRequest, badRequest', conflict, conflict', continue, continue', created, created', emptyResponse, emptyResponse', expectationFailed, expectationFailed', failedDependency, failedDependency', forbidden, forbidden', found, found', gatewayTimeout, gatewayTimeout', gone, gone', hTTPVersionNotSupported, hTTPVersionNotSupported', iMUsed, iMUsed', imATeapot, imATeapot', insufficientStorage, insufficientStorage', internalServerError, internalServerError', lengthRequired, lengthRequired', locked, locked', loopDetected, loopDetected', methodNotAllowed, methodNotAllowed', misdirectedRequest, misdirectedRequest', movedPermanently, movedPermanently', multiStatus, multiStatus', multipleChoices, multipleChoices', networkAuthenticationRequired, networkAuthenticationRequired', noContent, noContent', nonAuthoritativeInformation, nonAuthoritativeInformation', notAcceptable, notAcceptable', notExtended, notExtended', notFound, notFound', notImplemented, notImplemented', notModified, notModified', ok, ok', partialContent, partialContent', payloadTooLarge, payloadTooLarge', paymentRequired, paymentRequired', permanentRedirect, permanentRedirect', preconditionFailed, preconditionFailed', preconditionRequired, preconditionRequired', processing, processing', proxyAuthenticationRequired, proxyAuthenticationRequired', rangeNotSatisfiable, rangeNotSatisfiable', requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge', requestTimeout, requestTimeout', resetContent, resetContent', response, response', seeOther, seeOther', serviceUnavailable, serviceUnavailable', switchingProtocols, switchingProtocols', temporaryRedirect, temporaryRedirect', tooManyRequests, tooManyRequests', uRITooLong, uRITooLong', unauthorized, unauthorized', unavailableForLegalReasons, unavailableForLegalReasons', unprocessableEntity, unprocessableEntity', unsupportedMediaType, unsupportedMediaType', upgradeRequired, upgradeRequired', useProxy, useProxy', variantAlsoNegotiates, variantAlsoNegotiates') +import HTTPurple.Routes (type (<+>), combineRoutes, (<+>)) +import HTTPurple.Server (ServerM, serve, serve', serveSecure, serveSecure') +import HTTPurple.Status (Status) diff --git a/src/HTTPure/Body.purs b/src/HTTPurple/Body.purs similarity index 98% rename from src/HTTPure/Body.purs rename to src/HTTPurple/Body.purs index f94ad0e..6bb8520 100644 --- a/src/HTTPure/Body.purs +++ b/src/HTTPurple/Body.purs @@ -1,4 +1,4 @@ -module HTTPure.Body +module HTTPurple.Body ( class Body , RequestBody , defaultHeaders @@ -18,7 +18,7 @@ import Effect.Aff (Aff, makeAff, nonCanceler) import Effect.Class (liftEffect) import Effect.Ref (Ref) import Effect.Ref (modify, new, read, write) as Ref -import HTTPure.Headers (Headers, header) +import HTTPurple.Headers (Headers, header) import Node.Buffer (Buffer, concat, fromString, size) import Node.Buffer (toString) as Buffer import Node.Encoding (Encoding(UTF8)) @@ -95,7 +95,7 @@ toBuffer requestBody = do toStream :: RequestBody -> Readable () toStream = _.stream --- | Types that implement the `Body` class can be used as a body to an HTTPure +-- | Types that implement the `Body` class can be used as a body to an HTTPurple -- | response, and can be used with all the response helpers. class Body b where -- | Return any default headers that need to be sent with this body type, diff --git a/src/HTTPure/Headers.purs b/src/HTTPurple/Headers.purs similarity index 97% rename from src/HTTPure/Headers.purs rename to src/HTTPurple/Headers.purs index 049b323..db4851e 100644 --- a/src/HTTPure/Headers.purs +++ b/src/HTTPurple/Headers.purs @@ -1,4 +1,4 @@ -module HTTPure.Headers +module HTTPurple.Headers ( Headers(..) , empty , headers @@ -19,7 +19,7 @@ import Data.TraversableWithIndex (traverseWithIndex) import Data.Tuple (Tuple(Tuple)) import Effect (Effect) import Foreign.Object (fold) -import HTTPure.Lookup (class Lookup, (!!)) +import HTTPurple.Lookup (class Lookup, (!!)) import Node.HTTP (Request, Response, requestHeaders, setHeader) -- | The `Headers` type is just sugar for a `Object` of `Strings` diff --git a/src/HTTPure/Lookup.purs b/src/HTTPurple/Lookup.purs similarity index 99% rename from src/HTTPure/Lookup.purs rename to src/HTTPurple/Lookup.purs index 413f66b..3d18374 100644 --- a/src/HTTPure/Lookup.purs +++ b/src/HTTPurple/Lookup.purs @@ -1,4 +1,4 @@ -module HTTPure.Lookup +module HTTPurple.Lookup ( class Lookup , at , (!@) diff --git a/src/HTTPure/Method.purs b/src/HTTPurple/Method.purs similarity index 91% rename from src/HTTPure/Method.purs rename to src/HTTPurple/Method.purs index 752d67d..7fa2bde 100644 --- a/src/HTTPure/Method.purs +++ b/src/HTTPurple/Method.purs @@ -1,4 +1,4 @@ -module HTTPure.Method +module HTTPurple.Method ( Method(..) , read ) where @@ -7,7 +7,7 @@ import Prelude import Node.HTTP (Request, requestMethod) --- | These are the HTTP methods that HTTPure understands. +-- | These are the HTTP methods that HTTPurple understands. data Method = Get | Post diff --git a/src/HTTPure/Path.purs b/src/HTTPurple/Path.purs similarity index 94% rename from src/HTTPure/Path.purs rename to src/HTTPurple/Path.purs index 8988a12..5302ec8 100644 --- a/src/HTTPure/Path.purs +++ b/src/HTTPurple/Path.purs @@ -1,4 +1,4 @@ -module HTTPure.Path +module HTTPurple.Path ( Path , read ) where @@ -8,7 +8,7 @@ import Prelude import Data.Array (filter, head) import Data.Maybe (fromMaybe) import Data.String (Pattern(Pattern), split) -import HTTPure.Utils (urlDecode) +import HTTPurple.Utils (urlDecode) import Node.HTTP (Request, requestURL) -- | The `Path` type is just sugar for an `Array` of `String` segments that are diff --git a/src/HTTPure/Query.purs b/src/HTTPurple/Query.purs similarity index 95% rename from src/HTTPure/Query.purs rename to src/HTTPurple/Query.purs index 0bb4da8..8ae7360 100644 --- a/src/HTTPure/Query.purs +++ b/src/HTTPurple/Query.purs @@ -1,4 +1,4 @@ -module HTTPure.Query +module HTTPurple.Query ( Query , read ) where @@ -11,7 +11,7 @@ import Data.Maybe (fromMaybe) import Data.String (Pattern(Pattern), joinWith, split) import Data.Tuple (Tuple(Tuple)) import Foreign.Object (Object, fromFoldable) -import HTTPure.Utils (replacePlus, urlDecode) +import HTTPurple.Utils (replacePlus, urlDecode) import Node.HTTP (Request, requestURL) -- | The `Query` type is a `Object` of `Strings`, with one entry per query diff --git a/src/HTTPure/Request.purs b/src/HTTPurple/Request.purs similarity index 79% rename from src/HTTPure/Request.purs rename to src/HTTPurple/Request.purs index d2a378d..6b06a85 100644 --- a/src/HTTPure/Request.purs +++ b/src/HTTPurple/Request.purs @@ -1,4 +1,4 @@ -module HTTPure.Request +module HTTPurple.Request ( Request , fromHTTPRequest , fullPath @@ -12,19 +12,19 @@ import Data.String (joinWith) import Effect.Aff (Aff) import Effect.Class (liftEffect) import Foreign.Object (isEmpty, toArrayWithKey) -import HTTPure.Body (RequestBody) -import HTTPure.Body (read) as Body -import HTTPure.Headers (Headers) -import HTTPure.Headers (read) as Headers -import HTTPure.Method (Method) -import HTTPure.Method (read) as Method -import HTTPure.Path (Path) -import HTTPure.Path (read) as Path -import HTTPure.Query (Query) -import HTTPure.Query (read) as Query -import HTTPure.Utils (encodeURIComponent) -import HTTPure.Version (Version) -import HTTPure.Version (read) as Version +import HTTPurple.Body (RequestBody) +import HTTPurple.Body (read) as Body +import HTTPurple.Headers (Headers) +import HTTPurple.Headers (read) as Headers +import HTTPurple.Method (Method) +import HTTPurple.Method (read) as Method +import HTTPurple.Path (Path) +import HTTPurple.Path (read) as Path +import HTTPurple.Query (Query) +import HTTPurple.Query (read) as Query +import HTTPurple.Utils (encodeURIComponent) +import HTTPurple.Version (Version) +import HTTPurple.Version (read) as Version import Node.HTTP (Request) as HTTP import Node.HTTP (requestURL) import Routing.Duplex as RD @@ -54,7 +54,7 @@ fullPath request = "/" <> path <> questionMark <> queryParams queryParamsArr = toArrayWithKey stringifyQueryParam request.query stringifyQueryParam key value = encodeURIComponent key <> "=" <> encodeURIComponent value --- | Given an HTTP `Request` object, this method will convert it to an HTTPure +-- | Given an HTTP `Request` object, this method will convert it to an HTTPurple -- | `Request` object. fromHTTPRequest :: forall route. RD.RouteDuplex' route -> HTTP.Request -> Aff (Either (Request Unit) (Request route)) fromHTTPRequest route request = do diff --git a/src/HTTPure/Response.purs b/src/HTTPurple/Response.purs similarity index 98% rename from src/HTTPure/Response.purs rename to src/HTTPurple/Response.purs index 772561a..fdd3711 100644 --- a/src/HTTPure/Response.purs +++ b/src/HTTPurple/Response.purs @@ -1,4 +1,4 @@ -module HTTPure.Response +module HTTPurple.Response ( Response , ResponseM , send @@ -138,11 +138,11 @@ import Prelude import Effect.Aff (Aff) import Effect.Aff.Class (class MonadAff, liftAff) import Effect.Class (class MonadEffect, liftEffect) -import HTTPure.Body (class Body, defaultHeaders, write) -import HTTPure.Headers (Headers, empty) -import HTTPure.Headers (write) as Headers -import HTTPure.Status (Status) -import HTTPure.Status +import HTTPurple.Body (class Body, defaultHeaders, write) +import HTTPurple.Headers (Headers, empty) +import HTTPurple.Headers (write) as Headers +import HTTPurple.Status (Status) +import HTTPurple.Status ( accepted , alreadyReported , badGateway @@ -207,7 +207,7 @@ import HTTPure.Status ) as Status import Node.HTTP (Response) as HTTP --- | The `ResponseM` type simply conveniently wraps up an HTTPure monad that +-- | The `ResponseM` type simply conveniently wraps up an HTTPurple monad that -- | returns a response. This type is the return type of all router/route -- | methods. type ResponseM = Aff Response @@ -219,8 +219,8 @@ type Response = , writeBody :: HTTP.Response -> Aff Unit } --- | Given an HTTP `Response` and a HTTPure `Response`, this method will return --- | a monad encapsulating writing the HTTPure `Response` to the HTTP `Response` +-- | Given an HTTP `Response` and a HTTPurple `Response`, this method will return +-- | a monad encapsulating writing the HTTPurple `Response` to the HTTP `Response` -- | and closing the HTTP `Response`. send :: forall m. MonadEffect m => MonadAff m => HTTP.Response -> Response -> m Unit send httpresponse { status, headers, writeBody } = do diff --git a/src/HTTPure/Routes.purs b/src/HTTPurple/Routes.purs similarity index 90% rename from src/HTTPure/Routes.purs rename to src/HTTPurple/Routes.purs index f991c57..ddd2561 100644 --- a/src/HTTPure/Routes.purs +++ b/src/HTTPurple/Routes.purs @@ -1,4 +1,4 @@ -module HTTPure.Routes +module HTTPurple.Routes ( (<+>) , combineRoutes , orElse @@ -10,8 +10,8 @@ import Prelude import Control.Alt ((<|>)) import Data.Either (Either(..)) import Data.Profunctor.Choice ((|||)) -import HTTPure.Request (Request) -import HTTPure.Response (ResponseM) +import HTTPurple.Request (Request) +import HTTPurple.Response (ResponseM) import Record as Record import Routing.Duplex as RD import Type.Proxy (Proxy(..)) diff --git a/src/HTTPure/Server.purs b/src/HTTPurple/Server.purs similarity index 93% rename from src/HTTPure/Server.purs rename to src/HTTPurple/Server.purs index cbc264b..0124e59 100644 --- a/src/HTTPure/Server.purs +++ b/src/HTTPurple/Server.purs @@ -1,4 +1,4 @@ -module HTTPure.Server +module HTTPurple.Server ( ServerM , serve , serve' @@ -15,8 +15,8 @@ import Effect (Effect) import Effect.Aff (catchError, message, runAff) import Effect.Class (liftEffect) import Effect.Console (error) -import HTTPure.Request (Request, fromHTTPRequest) -import HTTPure.Response (ResponseM, internalServerError, notFound, send) +import HTTPurple.Request (Request, fromHTTPRequest) +import HTTPurple.Response (ResponseM, internalServerError, notFound, send) import Node.Encoding (Encoding(UTF8)) import Node.FS.Sync (readTextFile) import Node.HTTP (ListenOptions, close, listen) @@ -26,7 +26,7 @@ import Node.HTTP.Secure (createServer) as HTTPS import Routing.Duplex as RD -- | The `ServerM` is just an `Effect` containing a callback to close the --- | server. This type is the return type of the HTTPure serve and related +-- | server. This type is the return type of the HTTPurple serve and related -- | methods. type ServerM = Effect (Effect Unit -> Effect Unit) @@ -67,7 +67,7 @@ defaultNotFoundHandler = const notFound -- | Given a `ListenOptions` object, a function mapping `Request` to -- | `ResponseM`, and a `ServerM` containing effects to run on boot, creates and --- | runs a HTTPure server without SSL. +-- | runs a HTTPurple server without SSL. serve' :: forall route. ListenOptions -> @@ -81,7 +81,7 @@ serve' options { route, router, notFoundHandler } onStarted = do -- | Given a `Options HTTPS.SSLOptions` object and a `HTTP.ListenOptions` -- | object, a function mapping `Request` to `ResponseM`, and a `ServerM` --- | containing effects to run on boot, creates and runs a HTTPure server with +-- | containing effects to run on boot, creates and runs a HTTPurple server with -- | SSL. serveSecure' :: forall route. @@ -103,7 +103,7 @@ listenOptions port = , backlog: Nothing } --- | Create and start a server. This is the main entry point for HTTPure. Takes +-- | Create and start a server. This is the main entry point for HTTPurple. Takes -- | a port number on which to listen, a function mapping `Request` to -- | `ResponseM`, and a `ServerM` containing effects to run after the server has -- | booted (usually logging). Returns an `ServerM` containing the server's diff --git a/src/HTTPure/Status.purs b/src/HTTPurple/Status.purs similarity index 99% rename from src/HTTPure/Status.purs rename to src/HTTPurple/Status.purs index b7d7b4d..3ae1cc8 100644 --- a/src/HTTPure/Status.purs +++ b/src/HTTPurple/Status.purs @@ -1,4 +1,4 @@ -module HTTPure.Status +module HTTPurple.Status ( Status , write -- 1xx diff --git a/src/HTTPure/Utils.purs b/src/HTTPurple/Utils.purs similarity index 95% rename from src/HTTPure/Utils.purs rename to src/HTTPurple/Utils.purs index 2dd3ff2..ad01c03 100644 --- a/src/HTTPure/Utils.purs +++ b/src/HTTPurple/Utils.purs @@ -1,4 +1,4 @@ -module HTTPure.Utils +module HTTPurple.Utils ( encodeURIComponent , replacePlus , urlDecode diff --git a/src/HTTPure/Version.purs b/src/HTTPurple/Version.purs similarity index 90% rename from src/HTTPure/Version.purs rename to src/HTTPurple/Version.purs index 92a52cc..bd3dd65 100644 --- a/src/HTTPure/Version.purs +++ b/src/HTTPurple/Version.purs @@ -1,4 +1,4 @@ -module HTTPure.Version +module HTTPurple.Version ( Version(..) , read ) where @@ -7,7 +7,7 @@ import Prelude import Node.HTTP (Request, httpVersion) --- | These are the HTTP versions that HTTPure understands. There are five +-- | These are the HTTP versions that HTTPurple understands. There are five -- | commonly known versions which are explicitly named. data Version = HTTP0_9 diff --git a/test/Test/HTTPure/BodySpec.purs b/test/Test/HTTPurple/BodySpec.purs similarity index 93% rename from test/Test/HTTPure/BodySpec.purs rename to test/Test/HTTPurple/BodySpec.purs index 5038dd1..d8a839e 100644 --- a/test/Test/HTTPure/BodySpec.purs +++ b/test/Test/HTTPurple/BodySpec.purs @@ -1,4 +1,4 @@ -module Test.HTTPure.BodySpec where +module Test.HTTPurple.BodySpec where import Prelude @@ -6,13 +6,13 @@ import Data.Maybe (Maybe(Nothing), fromMaybe) import Effect.Aff (Aff) import Effect.Class (liftEffect) import Effect.Ref (new) as Ref -import HTTPure.Body (RequestBody, defaultHeaders, read, toBuffer, toStream, toString, write) -import HTTPure.Headers (header) +import HTTPurple.Body (RequestBody, defaultHeaders, read, toBuffer, toStream, toString, write) +import HTTPurple.Headers (header) import Node.Buffer (Buffer, fromString) import Node.Buffer (toString) as Buffer import Node.Encoding (Encoding(UTF8)) import Node.Stream (readString) -import Test.HTTPure.TestHelpers (Test, getResponseBody, mockRequest, mockResponse, stringToStream, (?=)) +import Test.HTTPurple.TestHelpers (Test, getResponseBody, mockRequest, mockResponse, stringToStream, (?=)) import Test.Spec (describe, it) mockRequestBody :: String -> Aff RequestBody diff --git a/test/Test/HTTPure/HeadersSpec.purs b/test/Test/HTTPurple/HeadersSpec.purs similarity index 95% rename from test/Test/HTTPure/HeadersSpec.purs rename to test/Test/HTTPurple/HeadersSpec.purs index 368457a..27e18f3 100644 --- a/test/Test/HTTPure/HeadersSpec.purs +++ b/test/Test/HTTPurple/HeadersSpec.purs @@ -1,14 +1,14 @@ -module Test.HTTPure.HeadersSpec where +module Test.HTTPurple.HeadersSpec where import Prelude import Data.Maybe (Maybe(Nothing, Just)) import Data.Tuple (Tuple(Tuple)) import Effect.Class (liftEffect) -import HTTPure.Headers (empty, header, headers, read, write) -import HTTPure.Lookup ((!!)) -import Test.HTTPure.TestHelpers ((?=)) -import Test.HTTPure.TestHelpers as TestHelpers +import HTTPurple.Headers (empty, header, headers, read, write) +import HTTPurple.Lookup ((!!)) +import Test.HTTPurple.TestHelpers ((?=)) +import Test.HTTPurple.TestHelpers as TestHelpers import Test.Spec (describe, it) lookupSpec :: TestHelpers.Test diff --git a/test/Test/HTTPure/IntegrationSpec.purs b/test/Test/HTTPurple/IntegrationSpec.purs similarity index 98% rename from test/Test/HTTPure/IntegrationSpec.purs rename to test/Test/HTTPurple/IntegrationSpec.purs index bd934bb..1c4d168 100644 --- a/test/Test/HTTPure/IntegrationSpec.purs +++ b/test/Test/HTTPurple/IntegrationSpec.purs @@ -1,4 +1,4 @@ -module Test.HTTPure.IntegrationSpec where +module Test.HTTPurple.IntegrationSpec where import Prelude @@ -19,7 +19,7 @@ import Examples.SSL.Main as SSL import Foreign.Object (empty, singleton) import Node.Buffer (toArray) import Node.FS.Aff (readFile) -import Test.HTTPure.TestHelpers +import Test.HTTPurple.TestHelpers ( Test , get , get' diff --git a/test/Test/HTTPure/LookupSpec.purs b/test/Test/HTTPurple/LookupSpec.purs similarity index 92% rename from test/Test/HTTPure/LookupSpec.purs rename to test/Test/HTTPurple/LookupSpec.purs index 1039d40..2cb8e85 100644 --- a/test/Test/HTTPure/LookupSpec.purs +++ b/test/Test/HTTPurple/LookupSpec.purs @@ -1,11 +1,11 @@ -module Test.HTTPure.LookupSpec where +module Test.HTTPurple.LookupSpec where import Prelude import Data.Maybe (Maybe(Nothing, Just)) import Foreign.Object (singleton) -import HTTPure.Lookup ((!!), (!?), (!@)) -import Test.HTTPure.TestHelpers (Test, (?=)) +import HTTPurple.Lookup ((!!), (!?), (!@)) +import Test.HTTPurple.TestHelpers (Test, (?=)) import Test.Spec (describe, it) atSpec :: Test diff --git a/test/Test/HTTPure/MethodSpec.purs b/test/Test/HTTPurple/MethodSpec.purs similarity index 90% rename from test/Test/HTTPure/MethodSpec.purs rename to test/Test/HTTPurple/MethodSpec.purs index a248800..f8b5f40 100644 --- a/test/Test/HTTPure/MethodSpec.purs +++ b/test/Test/HTTPurple/MethodSpec.purs @@ -1,12 +1,12 @@ -module Test.HTTPure.MethodSpec where +module Test.HTTPurple.MethodSpec where import Prelude -import HTTPure.Method +import HTTPurple.Method ( Method(Get, Post, Put, Delete, Head, Connect, Options, Trace, Patch) , read ) -import Test.HTTPure.TestHelpers (Test, mockRequest, (?=)) +import Test.HTTPurple.TestHelpers (Test, mockRequest, (?=)) import Test.Spec (describe, it) showSpec :: Test diff --git a/test/Test/HTTPure/PathSpec.purs b/test/Test/HTTPurple/PathSpec.purs similarity index 90% rename from test/Test/HTTPure/PathSpec.purs rename to test/Test/HTTPurple/PathSpec.purs index 89cd2b9..6df9ea1 100644 --- a/test/Test/HTTPure/PathSpec.purs +++ b/test/Test/HTTPurple/PathSpec.purs @@ -1,9 +1,9 @@ -module Test.HTTPure.PathSpec where +module Test.HTTPurple.PathSpec where import Prelude -import HTTPure.Path (read) -import Test.HTTPure.TestHelpers (Test, mockRequest, (?=)) +import HTTPurple.Path (read) +import Test.HTTPurple.TestHelpers (Test, mockRequest, (?=)) import Test.Spec (describe, it) readSpec :: Test diff --git a/test/Test/HTTPure/QuerySpec.purs b/test/Test/HTTPurple/QuerySpec.purs similarity index 94% rename from test/Test/HTTPure/QuerySpec.purs rename to test/Test/HTTPurple/QuerySpec.purs index 04be455..6d774eb 100644 --- a/test/Test/HTTPure/QuerySpec.purs +++ b/test/Test/HTTPurple/QuerySpec.purs @@ -1,11 +1,11 @@ -module Test.HTTPure.QuerySpec where +module Test.HTTPurple.QuerySpec where import Prelude import Data.Tuple (Tuple(Tuple)) import Foreign.Object (empty, fromFoldable, singleton) -import HTTPure.Query (read) -import Test.HTTPure.TestHelpers (Test, mockRequest, (?=)) +import HTTPurple.Query (read) +import Test.HTTPurple.TestHelpers (Test, mockRequest, (?=)) import Test.Spec (describe, it) readSpec :: Test diff --git a/test/Test/HTTPure/RequestSpec.purs b/test/Test/HTTPurple/RequestSpec.purs similarity index 91% rename from test/Test/HTTPure/RequestSpec.purs rename to test/Test/HTTPurple/RequestSpec.purs index 43f83e1..a0136d4 100644 --- a/test/Test/HTTPure/RequestSpec.purs +++ b/test/Test/HTTPurple/RequestSpec.purs @@ -1,4 +1,4 @@ -module Test.HTTPure.RequestSpec where +module Test.HTTPurple.RequestSpec where import Prelude @@ -11,15 +11,15 @@ import Data.Tuple (Tuple(Tuple)) import Effect.Aff (Aff) import Effect.Exception (error) import Foreign.Object (singleton) -import HTTPure.Body (toString) -import HTTPure.Headers (headers) -import HTTPure.Method (Method(Post)) -import HTTPure.Request (fromHTTPRequest, fullPath) -import HTTPure.Version (Version(HTTP1_1)) +import HTTPurple.Body (toString) +import HTTPurple.Headers (headers) +import HTTPurple.Method (Method(Post)) +import HTTPurple.Request (fromHTTPRequest, fullPath) +import HTTPurple.Version (Version(HTTP1_1)) import Routing.Duplex as RD import Routing.Duplex.Generic as G import Routing.Duplex.Generic.Syntax ((?)) -import Test.HTTPure.TestHelpers (Test, mockRequest, (?=)) +import Test.HTTPurple.TestHelpers (Test, mockRequest, (?=)) import Test.Spec (describe, it) data Route = Test { a :: Maybe String } diff --git a/test/Test/HTTPure/ResponseSpec.purs b/test/Test/HTTPurple/ResponseSpec.purs similarity index 94% rename from test/Test/HTTPure/ResponseSpec.purs rename to test/Test/HTTPurple/ResponseSpec.purs index 4269f65..3004559 100644 --- a/test/Test/HTTPure/ResponseSpec.purs +++ b/test/Test/HTTPurple/ResponseSpec.purs @@ -1,17 +1,17 @@ -module Test.HTTPure.ResponseSpec where +module Test.HTTPurple.ResponseSpec where import Prelude import Data.Either (Either(Right)) import Effect.Aff (makeAff, nonCanceler) import Effect.Class (liftEffect) -import HTTPure.Body (defaultHeaders) -import HTTPure.Headers (header) -import HTTPure.Response (emptyResponse, emptyResponse', response, response', send) +import HTTPurple.Body (defaultHeaders) +import HTTPurple.Headers (header) +import HTTPurple.Response (emptyResponse, emptyResponse', response, response', send) import Node.Encoding (Encoding(UTF8)) import Node.HTTP (responseAsStream) import Node.Stream (end, writeString) -import Test.HTTPure.TestHelpers +import Test.HTTPurple.TestHelpers ( Test , getResponseBody , getResponseHeader diff --git a/test/Test/HTTPure/ServerSpec.purs b/test/Test/HTTPurple/ServerSpec.purs similarity index 93% rename from test/Test/HTTPure/ServerSpec.purs rename to test/Test/HTTPurple/ServerSpec.purs index 40217e3..f027c7e 100644 --- a/test/Test/HTTPure/ServerSpec.purs +++ b/test/Test/HTTPurple/ServerSpec.purs @@ -1,4 +1,4 @@ -module Test.HTTPure.ServerSpec where +module Test.HTTPurple.ServerSpec where import Prelude @@ -10,9 +10,9 @@ import Data.Options ((:=)) import Effect.Class (liftEffect) import Effect.Exception (error) import Foreign.Object (empty) -import HTTPure.Request (Request) -import HTTPure.Response (ResponseM, notFound, ok) -import HTTPure.Server (serve, serve', serveSecure, serveSecure') +import HTTPurple.Request (Request) +import HTTPurple.Response (ResponseM, notFound, ok) +import HTTPurple.Server (serve, serve', serveSecure, serveSecure') import Node.Encoding (Encoding(UTF8)) import Node.FS.Sync (readTextFile) import Node.HTTP.Secure (key, keyString, cert, certString) @@ -20,7 +20,7 @@ import Routing.Duplex (RouteDuplex') import Routing.Duplex as RD import Routing.Duplex.Generic as G import Routing.Duplex.Generic as RG -import Test.HTTPure.TestHelpers (Test, (?=), get, get', getStatus) +import Test.HTTPurple.TestHelpers (Test, (?=), get, get', getStatus) import Test.Spec (describe, it) import Test.Spec.Assertions (expectError) diff --git a/test/Test/HTTPure/StatusSpec.purs b/test/Test/HTTPurple/StatusSpec.purs similarity index 72% rename from test/Test/HTTPure/StatusSpec.purs rename to test/Test/HTTPurple/StatusSpec.purs index c22f743..8395764 100644 --- a/test/Test/HTTPure/StatusSpec.purs +++ b/test/Test/HTTPurple/StatusSpec.purs @@ -1,10 +1,10 @@ -module Test.HTTPure.StatusSpec where +module Test.HTTPurple.StatusSpec where import Prelude import Effect.Class (liftEffect) -import HTTPure.Status (write) -import Test.HTTPure.TestHelpers (Test, getResponseStatus, mockResponse, (?=)) +import HTTPurple.Status (write) +import Test.HTTPurple.TestHelpers (Test, getResponseStatus, mockResponse, (?=)) import Test.Spec (describe, it) writeSpec :: Test diff --git a/test/Test/HTTPure/TestHelpers.js b/test/Test/HTTPurple/TestHelpers.js similarity index 100% rename from test/Test/HTTPure/TestHelpers.js rename to test/Test/HTTPurple/TestHelpers.js diff --git a/test/Test/HTTPure/TestHelpers.purs b/test/Test/HTTPurple/TestHelpers.purs similarity index 99% rename from test/Test/HTTPure/TestHelpers.purs rename to test/Test/HTTPurple/TestHelpers.purs index 01cdcbb..7b4eb19 100644 --- a/test/Test/HTTPure/TestHelpers.purs +++ b/test/Test/HTTPurple/TestHelpers.purs @@ -1,4 +1,4 @@ -module Test.HTTPure.TestHelpers where +module Test.HTTPurple.TestHelpers where import Prelude diff --git a/test/Test/HTTPure/UtilsSpec.purs b/test/Test/HTTPurple/UtilsSpec.purs similarity index 68% rename from test/Test/HTTPure/UtilsSpec.purs rename to test/Test/HTTPurple/UtilsSpec.purs index 7499b55..8d78447 100644 --- a/test/Test/HTTPure/UtilsSpec.purs +++ b/test/Test/HTTPurple/UtilsSpec.purs @@ -1,7 +1,7 @@ -module Test.HTTPure.UtilsSpec where +module Test.HTTPurple.UtilsSpec where -import HTTPure.Utils (replacePlus) -import Test.HTTPure.TestHelpers (Test, (?=)) +import HTTPurple.Utils (replacePlus) +import Test.HTTPurple.TestHelpers (Test, (?=)) import Test.Spec (describe, it) replacePlusSpec :: Test diff --git a/test/Test/HTTPure/VersionSpec.purs b/test/Test/HTTPurple/VersionSpec.purs similarity index 93% rename from test/Test/HTTPure/VersionSpec.purs rename to test/Test/HTTPurple/VersionSpec.purs index ac1af53..b3a1e93 100644 --- a/test/Test/HTTPure/VersionSpec.purs +++ b/test/Test/HTTPurple/VersionSpec.purs @@ -1,12 +1,12 @@ -module Test.HTTPure.VersionSpec where +module Test.HTTPurple.VersionSpec where import Prelude -import HTTPure.Version +import HTTPurple.Version ( Version(HTTP0_9, HTTP1_0, HTTP1_1, HTTP2_0, HTTP3_0, Other) , read ) -import Test.HTTPure.TestHelpers (Test, mockRequest, (?=)) +import Test.HTTPurple.TestHelpers (Test, mockRequest, (?=)) import Test.Spec (describe, it) showSpec :: Test diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 187d15a..0d70137 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -3,26 +3,26 @@ module Test.Main where import Prelude import Effect.Aff (launchAff_) -import Test.HTTPure.BodySpec (bodySpec) -import Test.HTTPure.HeadersSpec (headersSpec) -import Test.HTTPure.IntegrationSpec (integrationSpec) -import Test.HTTPure.LookupSpec (lookupSpec) -import Test.HTTPure.MethodSpec (methodSpec) -import Test.HTTPure.PathSpec (pathSpec) -import Test.HTTPure.QuerySpec (querySpec) -import Test.HTTPure.RequestSpec (requestSpec) -import Test.HTTPure.ResponseSpec (responseSpec) -import Test.HTTPure.ServerSpec (serverSpec) -import Test.HTTPure.StatusSpec (statusSpec) -import Test.HTTPure.TestHelpers (TestSuite) -import Test.HTTPure.UtilsSpec (utilsSpec) -import Test.HTTPure.VersionSpec (versionSpec) +import Test.HTTPurple.BodySpec (bodySpec) +import Test.HTTPurple.HeadersSpec (headersSpec) +import Test.HTTPurple.IntegrationSpec (integrationSpec) +import Test.HTTPurple.LookupSpec (lookupSpec) +import Test.HTTPurple.MethodSpec (methodSpec) +import Test.HTTPurple.PathSpec (pathSpec) +import Test.HTTPurple.QuerySpec (querySpec) +import Test.HTTPurple.RequestSpec (requestSpec) +import Test.HTTPurple.ResponseSpec (responseSpec) +import Test.HTTPurple.ServerSpec (serverSpec) +import Test.HTTPurple.StatusSpec (statusSpec) +import Test.HTTPurple.TestHelpers (TestSuite) +import Test.HTTPurple.UtilsSpec (utilsSpec) +import Test.HTTPurple.VersionSpec (versionSpec) import Test.Spec (describe) import Test.Spec.Reporter (specReporter) import Test.Spec.Runner (runSpec) main :: TestSuite -main = launchAff_ $ runSpec [ specReporter ] $ describe "HTTPure" do +main = launchAff_ $ runSpec [ specReporter ] $ describe "HTTPurple" do bodySpec headersSpec lookupSpec