如果我像下面这样设置approot
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
import Yesod.Core
data Yello = Yello
mkYesod "Yello" [parseRoutes|
/home1 Home1R GET
/home2 Home2R GET
|]
instance Yesod Yello where
approot = ApprootStatic "http://localhost:3000/v1"
getHome1R :: Handler Html
getHome1R = defaultLayout [whamlet|Homepage 01|]
getHome2R :: Handler Html
getHome2R = defaultLayout [whamlet|<a href=@{Home1R}>Homepage 02|]
main :: IO ()
main = warp 3000 Yello
然后将@{Home1R}
渲染到http://localhost:3000/v1/home1
,但是这个基于Yesod的小型Web应用程序只能在http://localhost:3000
上访问(没有{{1} }。
/v1
的目的是什么?approot
?