【发布时间】:2016-03-27 04:19:42
【问题描述】:
我在 Haskell 仆人中有一个 hello world 应用程序,这是其中的一部分:
type API =
"my_items" :> Get '[JSON] [MyItem]
:<|> "my_items" :> Capture "id" Int :> Get '[JSON] MyItem
-- ...................
网址是:
localhost/my_items
localhost/my_items/123
如何为现有网址和我将创建的其他网址添加前缀:
localhost/api/v1/my_items
localhost/api/v1/my_items/123
localhost/api/v1/.....
?
【问题讨论】: