choonkeat/elm-webapp/3.0.1

NOTE: the latest version is 3.0.2

Formerly choonkeat/create-elm-server, choonkeat/elm-fullstack. Search finds this package by either name.

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/choonkeat/elm-webapp.

What we checked: Tag 3.0.1 is still on github.com/choonkeat/elm-webapp; its commit 97b0974d1edb is from 2021-10-10 01:51 UTC, before the version was published (2021-10-10 01:52 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/choonkeat/elm-webapp/zipball/3.0.1/

Webapp.Server.HTTP

Data types and their helper functions to work with HTTP handlers

Definition

type alias Body =
String

Alias for String

type alias Headers =
Value

Alias for opaque Json.Encode.Value

type Method
= GET
| HEAD
| POST
| PUT
| DELETE
| CONNECT
| OPTIONS
| TRACE
| PATCH

Custom type representing all http methods

type alias Request =
Value

Alias for opaque Json.Encode.Value

type alias Response =
{ statusCode : StatusCode
, headers : List ( String, Value )
, body : String
}
= StatusContinue
| StatusSwitchingProtocols
| StatusProcessing
| StatusEarlyHints
| StatusOK
| StatusCreated
| StatusAccepted
| StatusNonAuthoritativeInformation
| StatusNoContent
| StatusResetContent
| StatusPartialContent
| StatusMultiStatus
| StatusAlreadyReported
| StatusIMUsed
| StatusMultipleChoices
| StatusMovedPermanently
| StatusFound
| StatusSeeOther
| StatusNotModified
| StatusUseProxy
| StatusTemporaryRedirect
| StatusPermanentRedirect
| StatusBadRequest
| StatusUnauthorized
| StatusPaymentRequired
| StatusForbidden
| StatusNotFound
| StatusMethodNotAllowed
| StatusNotAcceptable
| StatusProxyAuthenticationRequired
| StatusRequestTimeout
| StatusConflict
| StatusGone
| StatusLengthRequired
| StatusPreconditionFailed
| StatusPayloadTooLarge
| StatusURITooLong
| StatusUnsupportedMediaType
| StatusRangeNotSatisfiable
| StatusExpectationFailed
| StatusMisdirectedRequest
| StatusUnprocessableEntity
| StatusLocked
| StatusFailedDependency
| StatusTooEarly
| StatusUpgradeRequired
| StatusPreconditionRequired
| StatusTooManyRequests
| StatusRequestHeaderFieldsTooLarge
| StatusUnavailableForLegalReasons
| StatusInternalServerError
| StatusNotImplemented
| StatusBadGateway
| StatusServiceUnavailable
| StatusGatewayTimeout
| StatusHTTPVersionNotSupported
| StatusVariantAlsoNegotiates
| StatusInsufficientStorage
| StatusLoopDetected
| StatusNotExtended
| StatusNetworkAuthenticationRequired

Custom type representing all http StatusCode

type alias Url =
String

Alias for String

Common Helpers

bodyOf : Request -> String

Returns request body from Request

headersOf : Request -> Headers

Returns request headers from Request

Parse a String and return as http Method

methodOf : Request -> Method

Returns http method from Request

methodString : Method -> String

Returns http Method as String

pathOf : Request -> String

Returns request path from Request

Returns http StatusCode as integer

urlOf : Request -> String

Returns url from Request