每次我尝试运行此代码时,编译器都会为变量redirectUrlGraphEmail
、redirectUrlGraphPost
、aboutContents
和返回“不在范围内”错误staticDir
:
routes :: [ (String, ServerPart Response)]
routes = [
("graph-fb", seeOther redirectUrlGraphEmail $ toResponse ""),
("post-fb", seeOther redirectUrlGraphPost $ toResponse ""),
("about", aboutResponse aboutContents),
("static", serveDirectory DisableBrowsing [] staticDir)]
这些变量通过以下方式声明:
staticDir <- getStaticDir
redirectUrlGraphEmail <- retrieveAuthURL testUrl
redirectUrlGraphPost <- retrieveAuthURL testPostUrl
aboutContents <- LazyIO.readFile $ markdownPath ++ "README.md"
privacyContents <- LazyIO.readFile $ markdownPath ++ "PRIVACY.md"
但我不确定我应该在哪里将这些行添加到模块中。这里有什么帮助吗?