gpt4 book ai didi

haskell - 路线与资源

转载 作者:行者123 更新时间:2023-12-04 21:29:53 25 4
gpt4 key购买 nike

在 Yesod 书中,它在 Part I. Basics, Chapter 3. Basics, Section Routing (Second Edition) 中说明:

mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]

In other words, the preceding code simply creates a route [...] called HomeR. [...]. We call HomeR a resource, which is where the R suffix comes from.



这只是措辞,我知道,但我想了解是否 HomeR是路径或资源。
(请不要说“两者”)。

最佳答案

我的理解基于 this Yesod documentation page .

路线/ HomeR GET由。。。制成由。。。做成

  • 资源模式/
  • 资源名称 HomeR
  • GET处理程序

  • 据我所知,每个路由的资源名称都是唯一的,因此文档采用了将“资源名称为 X 的路由”称为“路由 X”的快捷方式。

    所以答案是: HomeR是一种资源,而 HomeR是资源名称为 HomeR的路由. (两者,换句话说)。

    关于haskell - 路线与资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56137144/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com