I have a hello world application in Haskell servant, here is part of it:
type API =
"my_items" :> Get '[JSON] [MyItem]
:<|> "my_items" :> Capture "id" Int :> Get '[JSON] MyItem
-- ...................
and URL:
localhost/my_items
localhost/my_items/123
How to add a prefix to existing URLs and others that I will create:
localhost/api/v1/my_items
localhost/api/v1/my_items/123
localhost/api/v1/.....
?
source
share