web ã¢ããªã®ãéçºä¸ã¯ãã¼ã«ã«ãã¹ãã§æ¤è¨¼ããå®éã®ãµã¼ãã¹ã¯ãªãã¼ã¹ãããã·ã®å¾ãã§éç¨ããæ¹æ³ã¯ããã£ãããã ãï¼
- yesod init ãã
- config/settings.yml ãé©åã«å¤æ´
yesod init ããã¨ãFoundation.hs ã«ä»¥ä¸ã®ãããªã³ã¼ããããã
instance Yesod Sample where approot = ApprootMaster $ appRoot . settings
ããã¯ãconfig/settings.yml ãããããªã«ããã¥ã¡ã³ãã«ã¼ãã決ãã¦ãããã¨ããæå³ããã®ãã¡ã¤ã«ã¯ãä¾ãã°ä»¥ä¸ã®ããã«æ¸ãã
Default: &defaults host: "127.0.0.1" port: 3000 copyright: Copyright (C) 2011 Kazu Yamamoto Development: <
ãã®ããã«ãDevelopmentãTestingãStagingãProduction ã¨ããã»ã¯ã·ã§ã³ãè¨å®ã§ããããã®å ã®ã©ãããä½æãã Yesod ã¢ããªã®èµ·åæã«æå®ããã
% sample Development
approot 㯠http://$(host):$(port)/ ã¨ããã«ã¼ã«ã§çæããããapproot èªä½ãããã°ããã¡ããåªå ãããã
ãã£ã¦ãä¸è¨ã® Development ã§ã¯ãhttp://127.0.0.1:3000/ ãããã¥ã¡ã³ãã«ã¼ãã¨ãªã£ã¦ã*:3000 ã§åãã127.0.0.1:3000 ã§ã¯ãªããã¨ã«æ³¨æãï¼ã¢ãã¬ã¹ãæå®ã§ããããã«ãããããé¡ããã¦ãããï¼
Production ã§ã¯ãhttp://example.com/app/sample/ ãããã¥ã¡ã³ãã«ã¼ãã¨ãªã£ã¦ããã¼ã *:3000 ã§åããapproot ãæå®ãã¦ãã¦ããport ã¯æå¹ã§ãããã¨ã«æ³¨æã
ãªãã¼ã¹ãããã·ã¨ web ã¢ããªãåä¸ãã¹ãã«ããå ´åãä»ã®ãã¹ãããã¢ã¯ã»ã¹ã§ããªãããã«ã127.0.0.1:3000 ã§åãã¹ãã ããä»ã¯ã§ããªãããªãã¼ã¹ãããã·ã«ã¯ã
http://example.com/app/sample/ â http://127.0.0.1:3000/
ã®ãããªå¤ææ å ±ãè¨å®ãã¦ããã(Mighty ãªãç°¡åã)