Api.Endpoint

This module exposes an opaque Endpoint type which is guaranteed to point to the correct Conduit API URL.

Get a URL to the Conduit API.

This is not publicly exposed, because we want to make sure the only way to get one of these URLs is from this module.

Request

type alias Request a =
{ method : String
, headers : List Header
, url : Endpoint
, body : Body
, decoder : Decoder a
}

A type to represent an HTTP request.

This is needed as we can't store a Cmd into an Effect if we want to be able to test it.

request : (Result Errors a -> msg) -> Request a -> Cmd msg

Turn the request into an actual Cmd.

Endpoints

Authors

profiles : Username -> Endpoint
follow : Username -> Endpoint

Articles

article : Slug -> Endpoint
articles : List QueryParameter -> Endpoint
feed : List QueryParameter -> Endpoint
favorite : Slug -> Endpoint
comment : Slug -> CommentId -> Endpoint
comments : Slug -> Endpoint