{"id":2746,"date":"2013-06-11T13:16:51","date_gmt":"2013-06-11T04:16:51","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=2746"},"modified":"2018-11-14T16:33:54","modified_gmt":"2018-11-14T07:33:54","slug":"yesod%e5%85%a5%e9%96%80-1-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%8b%e3%82%89%e8%b5%b7%e5%8b%95%e3%81%be%e3%81%a7","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2013\/06\/11\/yesod%e5%85%a5%e9%96%80-1-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%8b%e3%82%89%e8%b5%b7%e5%8b%95%e3%81%be%e3%81%a7\/","title":{"rendered":"Yesod\u5165\u9580 (1) \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u8d77\u52d5\u307e\u3067"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u00a0<a href=\"http:\/\/www.yesodweb.com\/\">Yesod<\/a> \u3068\u3044\u3046\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>Yesod \u306f Haskell \u3067\u4f5c\u3089\u308c\u305f\u30d5\u30eb\u30b9\u30bf\u30c3\u30af\u306e Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<\/p>\n<p>\u307e\u3060 Haskell \u306b\u8a73\u3057\u304f\u306a\u3044\u306e\u3067\u3001\u8a00\u8a9e\u3092\u5b66\u3073\u306a\u304c\u3089 Yesod \u3092\u4f7f\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>What's Yesod?<\/h2>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3088\u308b\u3068\u3001Yesod \u306f\u30bf\u30a4\u30d7\u30bb\u30fc\u30d5\u3067 RESTful \u306a\u30cf\u30a4\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9 Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u52b9\u7387\u826f\u304f\u958b\u767a\u3059\u308b\u305f\u3081\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>Why Yesod?<\/h2>\n<p>Yesod \u306b\u306f\u4ee5\u4e0b\u306e\u7279\u5fb4\u304c\u3042\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u30a8\u30e9\u30fc\u306b<br \/>\n\u6587\u5b57\u30b3\u30fc\u30c9\u7d61\u307f\u306e\u554f\u984c\u3084 XSS \u5bfe\u7b56\u306e\u305f\u3081\u306b\u3001\u3067\u304d\u308b\u3060\u3051\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u529b\u3092\u6d3b\u7528\u3059\u308b\u3002<\/li>\n<li>\u975e\u540c\u671f\u5316\u304c\u7c21\u5358<br \/>\n\u8a08\u91cf\u30b0\u30ea\u30fc\u30f3\u30b9\u30ec\u30c3\u30c9\u3068\u30a4\u30d9\u30f3\u30c8\u30d9\u30fc\u30b9\u306e\u30b7\u30b9\u30c6\u30e0\u30b3\u30fc\u30eb\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f\u7279\u306b\u82e6\u52b4\u305b\u305a\u306b\u975e\u540c\u671f\u5bfe\u5fdc\u3067\u304d\u308b\u3002<\/li>\n<li>\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u30cf\u30a4\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<br \/>\n\u666e\u901a\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u306f\u826f\u3044\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3067\u52d5\u304f\u304c\u3001\u3055\u3089\u306b\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3092\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3002<\/li>\n<li>\u8efd\u91cf\u306a\u30b7\u30f3\u30bf\u30c3\u30af\u30b9<br \/>\n\u30b7\u30f3\u30d7\u30eb\u306a DSL \u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3084\u6c38\u7d9a\u5316\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306a\u3069\u3092\u8a18\u8ff0\u53ef\u80fd\u3002<br \/>\n\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30c1\u30a7\u30c3\u30af\u3055\u308c\u308b\u306e\u3067\u3001\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>GHC (Glasgow Haskell Compiler) \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\"># Debian \u7cfb\u306e OS \u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067 apt-get \u3067\u3059.\r\nsudo apt-get install ghc<\/pre>\n<p>\u6b21\u306b\u3001haskell-platform \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get install haskell-platform<\/pre>\n<p>\u3053\u308c\u3067 cabal \u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">cabal update<\/pre>\n<p>\u6b21\u306b yesod-platform \u3068 yesod-bin \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">cabal install yesod-platform\r\ncabal install yesod-bin<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5931\u6557\u3059\u308b\u5834\u5408\u306f\u300c--force-reinstall\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u6210\u529f\u3059\u308b\u3053\u3068\u3082\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001yesod \u30b3\u30de\u30f3\u30c9\u306a\u3069\u306f ~\/.cabal\/bin<strong><\/strong> \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u306e\u3067\u3001PATH \u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">export PATH=~\/.cabal\/bin:$PATH<\/pre>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u3068\u3057\u3066\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ yesod version\r\nyesod-bin version: 1.2.0.1<\/pre>\n<p>\u554f\u984c\u7121\u304f\u5b9f\u884c\u3067\u304d\u308c\u3070\u3001Yesod \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h2>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">yesod init<\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u540d\u524d\u306e\u5165\u529b\u3092\u4fc3\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">Welcome to the Yesod scaffolder.\r\nI'm going to be creating a skeleton Yesod project for you.\r\n\r\nWhat do you want to call your project? We'll use this for the cabal name.\r\n\r\nProject name:<\/pre>\n<p>\u3053\u3053\u3067\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3092\u300chello-yesod\u300d\u3068\u3057\u3066\u9032\u3081\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u7a2e\u985e\u306e\u9078\u629e\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">Yesod uses Persistent for its (you guessed it) persistence layer.\r\nThis tool will build in either SQLite or PostgreSQL or MongoDB support for you.\r\nWe recommend starting with SQLite: it has no dependencies.\r\n\r\n    s      = sqlite\r\n    p      = postgresql\r\n    pf     = postgresql + Fay (experimental)\r\n    mongo  = mongodb\r\n    mysql  = MySQL\r\n    simple = no database, no auth\r\n    url    = Let me specify URL containing a site (advanced)\r\n\r\nSo, what'll it be?<\/pre>\n<p>\u4eca\u56de\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u300csimple\u300d\u3068\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u306f\u5b8c\u4e86\u3067\u3059\u306e\u3067\u3001\u4f5c\u6210\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">cd hello-yesod<\/pre>\n<p>\u6700\u5f8c\u306b\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">cabal install<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u8d77\u52d5<\/h2>\n<p>\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">yesod devel<\/pre>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f 3000 \u30dd\u30fc\u30c8\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\uff08--port \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30dd\u30fc\u30c8\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\uff09\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067 http:\/\/localhost:3000 \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2013\/06\/yesod-01.png\" rel=\"facebox\" rel=\"attachment wp-att-2750\"><img loading=\"lazy\" class=\"wp-image-2750 alignnone\" style=\"border: 1px solid black;\" alt=\"yesod-01\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2013\/06\/yesod-01.png\" width=\"572\" height=\"267\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2013\/06\/yesod-01.png 953w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2013\/06\/yesod-01-300x140.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/a><\/p>\n<p>\u8d77\u52d5\u3057\u305f\u30b5\u30fc\u30d0\u306f Enter \u30ad\u30fc\u3067\u7d42\u4e86\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u00a0Yesod \u3068\u3044\u3046\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>Yesod \u306f Haskell \u3067\u4f5c\u3089\u308c\u305f\u30d5\u30eb\u30b9\u30bf\u30c3\u30af\u306e Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2013\/06\/11\/yesod%e5%85%a5%e9%96%80-1-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%8b%e3%82%89%e8%b5%b7%e5%8b%95%e3%81%be%e3%81%a7\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,18,84],"tags":[99,100],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/2746"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=2746"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/2746\/revisions"}],"predecessor-version":[{"id":17927,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/2746\/revisions\/17927"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=2746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=2746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=2746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}