README for the example server lists the following endpoints, but only the first currently works:
http://localhost:8080/users - responds with a list of User resources
http://localhost:8080/users/1 - responds with a singleton resource
http://localhost:8080/users/2 - responds with a singleton resource
http://localhost:8080/users/3 - responds with a 404 and error payload
It looks like the correct endpoints are:
http://localhost:8080/users - responds with a list of User resources
http://localhost:8080/users/1/simple - responds with a singleton resource
http://localhost:8080/users/1/full - responds with a singleton resource
http://localhost:8080/users/2/simple - responds with a singleton resource
http://localhost:8080/users/2/full - responds with a singleton resource
http://localhost:8080/users/3/simple - responds with a 404 and error payload
http://localhost:8080/users/3/full - responds with a 404 and error payload
Alternatively, to make the originally stated endpoints available, the following endpoint can be added to the API type in example/src/Lib.hs:
:<|> "users" :> Capture "id" Int :> Get '[JSON] (Document User)
Along with a matching handler on the Server in the same file:
README for the example server lists the following endpoints, but only the first currently works:
It looks like the correct endpoints are:
Alternatively, to make the originally stated endpoints available, the following endpoint can be added to the
API
type inexample/src/Lib.hs
:Along with a matching handler on the
Server
in the same file: