{"id":256780,"date":"2015-05-07T16:02:02","date_gmt":"2015-05-07T12:02:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256780"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256780","title":{"rendered":"REST-\u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043d\u0430 Haskell"},"content":{"rendered":"<p>             \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043b \u043e\u0442 \u044f\u0437\u044b\u043a\u043e\u0432 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u043e-\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435. Haskell \u043f\u0440\u0438\u0433\u043b\u044f\u043d\u0443\u043b\u0441\u044f \u043c\u043d\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u043e\u0439 \u043a\u043e\u0434\u0430 \u0438 \u0431\u0435\u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u043d\u044b\u043c \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u042f \u0437\u0430\u043b\u043f\u043e\u043c \u043f\u0440\u043e\u0433\u043b\u043e\u0442\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043d\u0438\u0436\u0435\u043a \u043f\u043e Haskell \u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0443\u0436\u0435 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c.<\/p>\n<p>  \u0418 \u0442\u0443\u0442-\u0442\u043e \u043c\u0435\u043d\u044f \u0436\u0434\u0430\u043b\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u044f \u043d\u0435 \u0431\u044b\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 hello world-a. \u0422.\u0435. \u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0442\u0438\u043f\u0430 find \u0438\u043b\u0438 \u0432\u0440\u043e\u0434\u0435 \u0442\u043e\u0433\u043e, \u2014 \u043d\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430 \u0441 IO \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u043b\u0430 \u0432\u0441\u0435 \u043c\u043e\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f Haskell \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043c\u043d\u043e\u0433\u043e, \u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0438\u043c \u043f\u043e\u0447\u0442\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442\u0443. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e.<\/p>\n<p>  \u0421\u0438\u043c\u043f\u0442\u043e\u043c\u044b \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u0434\u0438\u0430\u0433\u043d\u043e\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438. \u0410 \u0434\u043b\u044f Haskell \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e, \u0442.\u043a. \u044f\u0437\u044b\u043a \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439. \u0414\u0430\u0436\u0435 \u0442\u043e, \u0447\u0442\u043e \u044f \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u044e Clojure, \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u0442.\u043a. Clojure \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Haskell \u2014 \u043d\u0430 \u0438\u0445 \u0442\u0438\u043f\u0430\u0445.<\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0432 Haskell. \u041f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0436 \u0431\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c desktop- \u0438\u043b\u0438 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e \u0445\u0430\u0441\u043a\u0435\u043b\u0438\u0441\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Haskell \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 Haskell, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043e\u0439\u0442\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u044b\u0445: \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <a href=\"https:\/\/github.com\/dbushenko\/scotty-blog\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443: \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 tutorial \u043f\u043e <a href=\"http:\/\/www.yesodweb.com\">Yesod<\/a>. \u042d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0447\u0435\u0440\u0435\u0437\u0447\u0443\u0440 \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0438\u043a\u0442\u0443\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u043d\u0435 \u0441\u043e \u0432\u0441\u0435\u043c \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0430\u0437\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043a\u0430 <a href=\"https:\/\/hackage.haskell.org\/package\/scotty\">Scotty<\/a>, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0430\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 <a href=\"https:\/\/hackage.haskell.org\/package\/warp\">Warp<\/a>.<\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430. \u0411\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b:  <\/p>\n<ul>\n<li>GET \/articles \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0430\u0442\u0435\u0439. <\/li>\n<li>GET \/articles\/:id \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f. <\/li>\n<li>PUT \/admin\/articles \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e. <\/li>\n<li>POST \/admin\/articles \u2014 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e. <\/li>\n<li>DELETE \/admin\/articles\/:id \u2014 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e. <\/li>\n<\/ul>\n<p>  \u0412\u0441\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u00ab\/admin\u00bb \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043b\u044f stateless-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/en.wikipedia.org\/wiki\/Basic_access_authentication\">Basic-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e<\/a>, \u0442.\u043a. \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/p>\n<h4>\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f?<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f Haskell, \u043e\u0431\u0449\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043c\u043e\u043d\u0430\u0434 \u0438 \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u043e\u0432, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0442.\u0434.<\/li>\n<li>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 cabal, \u0443\u043c\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c sandbox-\u044b, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/li>\n<li>MySQL \u0438 \u0441\u0430\u043c\u044b\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043d\u0435\u043c.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.  <\/p>\n<ul>\n<li>Web-\u0441\u0435\u0440\u0432\u0435\u0440 \u2014 Warp.<\/li>\n<li>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u2014 Scotty.<\/li>\n<li>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 configurator.<\/li>\n<li>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0411\u0414: mysql \u0438 mysql-simple.<\/li>\n<li>\u041f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0411\u0414: resource-pool.<\/li>\n<li>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u2014 REST \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c JSON, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u2014 aeson.<\/li>\n<li>wai-extra \u0434\u043b\u044f basic-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0442.\u043a. \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 stateless.<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438.   <\/p>\n<ul>\n<li>Main.hs \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>Db.hs \u2014 \u0432\u0441\u0435, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>View.hs \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. <\/li>\n<li>Domain.hs \u0442\u0438\u043f\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e.<\/li>\n<li>Auth.hs \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c<\/h4>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 cabal \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">\tmkdir hblog \tcd hblog \tcabal init <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0440\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0438\u043f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Executable, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u2014 Main.hs, \u0434\u0438\u0440\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u2014 src. \u0412\u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 build-depends \u0432 \u0444\u0430\u0439\u043b hblog.cabal:<\/p>\n<pre><code class=\"haskell\">   base                          &gt;= 4.6        && &lt; 4.7  , scotty                        &gt;= 0.9.1  , bytestring                    &gt;= 0.9        && &lt; 0.11  , text                          &gt;= 0.11       && &lt; 2.0  , mysql                         &gt;= 0.1.1.8  , mysql-simple                  &gt;= 0.2.2.5  , aeson                         &gt;= 0.6        && &lt; 0.9  , HTTP                          &gt;= 4000.2.19  , transformers                  &gt;= 0.4.3.0  , wai                           &gt;= 3.0.2.3  , wai-middleware-static         &gt;= 0.7.0.1  , wai-extra                     &gt;= 3.0.7  , resource-pool                 &gt;= 0.2.3.2  , configurator                  &gt;= 0.3.0.0  , MissingH                      &gt;= 1.3.0.1 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0434\u0430\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0430\u0434\u0441\u043a\u043e\u0439 \u043d\u0435\u0440\u0430\u0437\u0431\u0435\u0440\u0438\u0445\u0438 \u0441 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443.<\/p>\n<pre><code class=\"bash\">\tcabal sandbox init \tcabal install \u2014dependencies-only  <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b src\/Main.hs.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Scotty. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u043f\u044b\u0442 \u0441 Sinatra, Compojure \u0438\u043b\u0438 Scalatra \u2014 \u0441\u0447\u0438\u0442\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0442.\u043a. \u044d\u0442\u043e\u0442 \u043e\u043f\u044b\u0442 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 src\/Main.hs:<\/p>\n<pre><code class=\"haskell\">{-# LANGUAGE OverloadedStrings #-}  import Web.Scotty  import Data.Monoid (mconcat)  main = scotty 3000 $ do   get &quot;\/:word&quot; $ do     beam &lt;- param &quot;word&quot;     html $ mconcat [&quot;&lt;h1&gt;Scotty, &quot;, beam, &quot; me up!&lt;\/h1&gt;&quot;] <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u0430 \u0432 \u0438\u0437\u0443\u043c\u043b\u0435\u043d\u0438\u0435: \u0447\u0442\u043e \u0435\u0449\u0435 \u0437\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438? \u0421\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u044a\u044f\u0441\u043d\u044e.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f, \u043a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435, \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c Haskell \u0441 \u043a\u043d\u0438\u0433 \u00ab<a href=\"http:\/\/learnyouahaskell.com\/\">Learn you a Haskell for a greater good<\/a>\u00bb \u0438 \u00ab<a href=\"http:\/\/book.realworldhaskell.org\/\">Real World Haskell<\/a>\u00bb, \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u0442\u0430\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430. \u0421\u0430\u043c\u043e\u0435 \u043b\u0443\u0447\u0448\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432 Haskell \u044f \u043d\u0430\u0448\u0435\u043b \u0432 \u043a\u043d\u0438\u0433\u0435 \u00ab<a href=\"http:\/\/www.amazon.com\/Beginning-Haskell-A-Project-Based-Approach\/dp\/1430262508\">Beginning Haskell<\/a>\u00bb \u0432 \u0433\u043b\u0430\u0432\u0435 10.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<ul>\n<li>String \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0445 ASCII-\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u0445, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u044f\u0437\u044b\u043a.<\/li>\n<li>Text \u2014 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u0434\u043b\u044f ASCII, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f UTF-\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 text \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u0430\u0445: \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0438 \u043b\u0435\u043d\u0438\u0432\u043e\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 <a href=\"https:\/\/hackage.haskell.org\/package\/text\">\u0437\u0434\u0435\u0441\u044c<\/a><\/li>\n<li>ByteString \u2014 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a \u0432 \u043f\u043e\u0442\u043e\u043a \u0431\u0430\u0439\u0442\u043e\u0432. \u041f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/hackage.haskell.org\/package\/bytestring\">bytestring<\/a> \u0438 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445: \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u0438 \u043b\u0435\u043d\u0438\u0432\u043e\u043c.<\/li>\n<\/ul>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 OverloadedStrings. \u0428\u0442\u0443\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0441\u0442\u0440\u0435\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 T.pack \u00abHello\u00bb \u0442\u0430\u043c, \u0433\u0434\u0435 \u043b\u0435\u043a\u0441\u0435\u043c\u0443 \u00abHello\u00bb \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Text; \u0438\u043b\u0438 B.pack \u00abHello\u00bb \u0442\u0430\u043c, \u0433\u0434\u0435 \u043b\u0435\u043a\u0441\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 ByteString. \u0412\u043e\u0442 \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0443\u0441\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0440\u0435\u043a\u0442\u0438\u0432\u0430 OverloadedStrings, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0439 \u043b\u0435\u043a\u0441\u0435\u043c\u044b \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u0442\u0438\u043f\u0443.<\/p>\n<h4>\u0424\u0430\u0439\u043b Main.hs<\/h4>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"haskell\">main :: IO () main = do  -- \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b application.conf, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445     loadedConf &lt;- C.load [C.Required &quot;application.conf&quot;]     dbConf &lt;- makeDbConfig loadedConf          case dbConf of       Nothing -&gt; putStrLn &quot;No database configuration found, terminating...&quot;       Just conf -&gt; do -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 (\u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u2014 5 \u0441\u0435\u043a\u0443\u043d\u0434, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0411\u0414 -- 10)                 pool &lt;- createPool (newConn conf) close 1 5 10 -- \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 Scotty           scotty 3000 $ do -- \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u0438\u0437 \u0434\u0438\u0440\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u00abstatic\u00bb               middleware $ staticPolicy (noDots &gt;-&gt; addBase &quot;static&quot;) -- \u041b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 logStdout \u0432\u043c\u0435\u0441\u0442\u043e logStdoutDev               middleware $ logStdoutDev -- \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432               middleware $ basicAuth (verifyCredentials pool)                            &quot;Haskell Blog Realm&quot; { authIsProtected = protectedResources }                get    &quot;\/articles&quot; $ do articles &lt;- liftIO $ listArticles pool                                       articlesList articles -- \u041f\u043e\u043b\u0443\u0447\u0438\u0442 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 :id \u0438 \u043d\u0430\u0439\u0434\u0435\u0442 \u0432 \u0411\u0414 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c               get    &quot;\/articles\/:id&quot; $ do id &lt;- param &quot;id&quot; :: ActionM TL.Text                                           maybeArticle &lt;- liftIO $ findArticle pool id                                           viewArticle maybeArticle -- \u0420\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0442\u0438\u043f Article \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c Article \u0432 \u0411\u0414               put    &quot;\/admin\/articles&quot; $ do article &lt;- getArticleParam                                             insertArticle pool article                                             createdArticle article                post   &quot;\/admin\/articles&quot; $ do article &lt;- getArticleParam                                             updateArticle pool article                                             updatedArticle article                delete &quot;\/admin\/articles\/:id&quot; $ do id &lt;- param &quot;id&quot; :: ActionM TL.Text                                                 deleteArticle pool id                                                 deletedArticle id <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c <a href=\"http:\/\/ruhaskell.org\/posts\/packages\/2015\/01\/21\/configurator.html\">configurator<\/a>. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 application.conf, \u0438 \u0432\u043e\u0442 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<pre><code class=\"javascript\">database {   name = &quot;hblog&quot;   user = &quot;hblog&quot;   password = &quot;hblog&quot; } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0443\u043b\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 resource-pool. \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0411\u0414 \u2014 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u0434\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435. \u0422\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 createPool \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"haskell\">createPool :: IO a -&gt; (a -&gt; IO ()) -&gt; Int -&gt; NominalDiffTime -&gt; Int -&gt; IO (Pool a) createPool create destroy numStripes idleTime maxResources <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c create \u0438 destroy \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, numStripes \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0443\u0431-\u043f\u0443\u043b\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, idleTime \u2014 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445), maxResources \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u0443\u0431-\u043f\u0443\u043b\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e newConn (\u0438\u0437 Db.hs).<\/p>\n<pre><code class=\"haskell\">data DbConfig = DbConfig {      dbName :: String,      dbUser :: String,      dbPassword :: String      }      deriving (Show, Generic)  newConn :: DbConfig -&gt; IO Connection newConn conf = connect defaultConnectInfo                        { connectUser = dbUser conf                        , connectPassword = dbPassword conf                        , connectDatabase = dbName conf                        } <\/code><\/pre>\n<p>  \u041d\u0443 \u0430 \u0441\u0430\u043c DbConfig \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"haskell\">makeDbConfig :: C.Config -&gt; IO (Maybe Db.DbConfig) makeDbConfig conf = do   name &lt;- C.lookup conf &quot;database.name&quot; :: IO (Maybe String)   user &lt;- C.lookup conf &quot;database.user&quot; :: IO (Maybe String)   password &lt;- C.lookup conf &quot;database.password&quot; :: IO (Maybe String)   return $ DbConfig &lt;$&gt; name                     &lt;*&gt; user                     &lt;*&gt; password <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f Data.Configurator.Config, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u043b\u0438 \u0438\u0437 application.conf, \u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u2014 Maybe DbConfig, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 IO.<\/p>\n<p>  \u0422\u0430\u043a\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439, \u0438 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<br \/>  \u0422\u0438\u043f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f C.lookup conf \u00abdatabase.name\u00bb \u2014 \u044d\u0442\u043e Maybe String, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 IO. \u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0435\u0433\u043e \u0438\u0437 IO \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"haskell\">name &lt;- C.lookup conf &quot;database.name&quot; :: IO (Maybe String) <\/code><\/pre>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 name, user, password \u0442\u0438\u043f \u2014 Maybe String.<\/p>\n<p>  \u0422\u0438\u043f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 DbConfig \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"haskell\">DbConfig :: String -&gt; String -&gt; String -&gt; DbConfig  <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 DbConfig.<\/p>\n<p>  \u0422\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (&lt;$&gt;) \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"haskell\">(&lt;$&gt;) :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b <\/code><\/pre>\n<p>  \u0422.\u0435. \u043e\u043d \u0431\u0435\u0440\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0444\u0443\u043d\u043a\u0442\u043e\u0440 \u0438 \u0432\u043e\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0442\u043e\u0440 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439 \u043a \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u041a\u043e\u0440\u043e\u0447\u0435, \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 map.<\/p>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044c DbConfig &lt;$&gt; name \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 name \u0441\u0442\u0440\u043e\u043a\u0443 (\u0442\u0438\u043f name \u2014 \u044d\u0442\u043e Maybe String) \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 DbConfig \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0435 Maybe \u043a\u0430\u0440\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 DbConfig:<\/p>\n<pre><code class=\"haskell\">DbConfig &lt;$&gt; name :: Maybe (String -&gt; String -&gt; DbConfig)  <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u043d\u0430 \u043e\u0434\u0438\u043d String \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>  \u0422\u0438\u043f (&lt;*&gt;) \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 &lt;$&gt;:<\/p>\n<pre><code class=\"haskell\">(&lt;*&gt;) :: Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b <\/code><\/pre>\n<p>  \u041e\u043d \u0431\u0435\u0440\u0435\u0442 \u0444\u0443\u043d\u043a\u0442\u043e\u0440, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0431\u0435\u0440\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u0443\u043d\u043a\u0442\u043e\u0440 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u0430 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0442\u043e\u0440.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043f\u0438\u0441\u044c DbConfig &lt;$&gt; name &lt;*&gt; user \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f: <\/p>\n<pre><code class=\"haskell\">DbConfig &lt;$&gt; name &lt;*&gt; user :: Maybe (String -&gt; DbConfig) <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 String-\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c password-\u043e\u043c:<\/p>\n<pre><code class=\"haskell\">DbConfig &lt;$&gt; name  \t     &lt;*&gt; user  \t     &lt;*&gt; password  :: Maybe DbConfig <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u2014 \u044d\u0442\u043e middleware basicAuth. \u0422\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 basicAuth \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"haskell\">basicAuth :: CheckCreds -&gt; AuthSettings -&gt; Middleware <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0430\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0411\u0414, \u0432\u0442\u043e\u0440\u0430\u044f \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0437\u0430\u0449\u0438\u0442\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439. \u0418\u0445 \u0442\u0438\u043f\u044b:<\/p>\n<pre><code class=\"haskell\">type CheckCreds = ByteString -&gt; ByteString -&gt; ResourceT IO Bool  data AuthSettings = AuthSettings     { authRealm :: !ByteString      , authOnNoAuth :: !(ByteString -&gt; Application)      , authIsProtected :: !(Request -&gt; ResourceT IO Bool)     } <\/code><\/pre>\n<p>  \u0422\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 AuthSettings \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0433\u043b\u0443\u0431\u0436\u0435 \u0441 \u043d\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u2014 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <a href=\"https:\/\/hackage.haskell.org\/package\/wai-extra-1.3.4.5\/docs\/src\/Network-Wai-Middleware-HttpAuth.html#AuthSettings\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041d\u0430\u0441 \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 authIsProtected. \u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e Request-\u0443 \u0443\u043c\u0435\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u0438\u043b\u0438 \u043d\u0435\u0442. \u0412\u043e\u0442 \u0435\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430:<\/p>\n<pre><code class=\"haskell\">protectedResources ::  Request -&gt; IO Bool protectedResources request = do     let path = pathInfo request     return $ protect path     where protect (p : _) =  p == &quot;admin&quot;           protect _        =  False <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f pathInfo \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f:<\/p>\n<pre><code class=\"haskell\">pathInfo :: Request -&gt; [Text] <\/code><\/pre>\n<p>  \u041e\u043d\u0430 \u0431\u0435\u0440\u0435\u0442 Request \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044e \u00ab\/\u00bb.<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u00ab\/admin\u00bb, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f protectedResources \u0432\u0435\u0440\u043d\u0435\u0442 IO True, \u0442\u0440\u0435\u0431\u0443\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f verifyCredentials, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0441 \u0411\u0414, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e \u043d\u0435\u0439 \u2014 \u043d\u0438\u0436\u0435.<\/p>\n<h4>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u0423\u0442\u0438\u043b\u0438\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u043b\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"haskell\">fetchSimple :: QueryResults r =&gt; Pool M.Connection -&gt; Query -&gt; IO [r] fetchSimple pool sql = withResource pool retrieve        where retrieve conn = query_ conn sql  fetch :: (QueryResults r, QueryParams q) =&gt; Pool M.Connection -&gt; q -&gt; Query -&gt; IO [r] fetch pool args sql = withResource pool retrieve       where retrieve conn = query conn sql args <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044e fetchSimple \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0430 fetch \u2014 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 execSql:<\/p>\n<pre><code class=\"haskell\">execSql :: QueryParams q =&gt; Pool M.Connection -&gt; q -&gt; Query -&gt; IO Int64 execSql pool args sql = withResource pool ins        where ins conn = execute conn sql args <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e, \u0442\u043e \u0432\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f execSqlT:<\/p>\n<pre><code class=\"haskell\">execSqlT :: QueryParams q =&gt; Pool M.Connection -&gt; q -&gt; Query -&gt; IO Int64 execSqlT pool args sql = withResource pool ins        where ins conn = withTransaction conn $ execute conn sql args <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e fetch \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0439\u0442\u0438 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0411\u0414 \u043f\u043e \u0435\u0433\u043e \u043b\u043e\u0433\u0438\u043d\u0443:<\/p>\n<pre><code class=\"haskell\">findUserByLogin :: Pool Connection -&gt; String -&gt; IO (Maybe String) findUserByLogin pool login = do          res &lt;- liftIO $ fetch pool (Only login)  \t\t\t      &quot;SELECT * FROM user WHERE login=?&quot; :: IO [(Integer, String, String)]          return $ password res          where password [(_, _, pwd)] = Just pwd                password _ = Nothing <\/code><\/pre>\n<p>  \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 Auth.hs:<\/p>\n<pre><code class=\"haskell\">verifyCredentials :: Pool Connection -&gt; B.ByteString -&gt; B.ByteString -&gt; IO Bool verifyCredentials pool user password = do    pwd &lt;- findUserByLogin pool (BC.unpack user)    return $ comparePasswords pwd (BC.unpack password)    where comparePasswords Nothing _ = False          \t  comparePasswords (Just p) password =  p == (md5s $ Str password) <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u0411\u0414 \u043d\u0430\u0439\u0434\u0435\u043d, \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 md5.<\/p>\n<p>  \u041d\u043e \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043d\u043e \u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043b\u043e\u0433 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c-\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c-\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c. \u0412 \u0444\u0430\u0439\u043b\u0435 Domain.hs \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 Article c \u043f\u043e\u043b\u044f\u043c\u0438 id title bodyText:<\/p>\n<pre><code class=\"haskell\">data Article = Article Integer Text Text      deriving (Show) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CRUD \u0432 \u0411\u0414 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"haskell\">listArticles :: Pool Connection -&gt; IO [Article] listArticles pool = do      res &lt;- fetchSimple pool &quot;SELECT * FROM article ORDER BY id DESC&quot; :: IO [(Integer, TL.Text, TL.Text)]      return $ map (\\(id, title, bodyText) -&gt; Article id title bodyText) res     findArticle :: Pool Connection -&gt; TL.Text -&gt; IO (Maybe Article) findArticle pool id = do      res &lt;- fetch pool (Only id) &quot;SELECT * FROM article WHERE id=?&quot; :: IO [(Integer, TL.Text, TL.Text)]      return $ oneArticle res      where oneArticle ((id, title, bodyText) : _) = Just $ Article id title bodyText            oneArticle _ = Nothing   insertArticle :: Pool Connection -&gt; Maybe Article -&gt; ActionT TL.Text IO () insertArticle pool Nothing = return () insertArticle pool (Just (Article id title bodyText)) = do      liftIO $ execSqlT pool [title, bodyText]                             &quot;INSERT INTO article(title, bodyText) VALUES(?,?)&quot;      return ()  updateArticle :: Pool Connection -&gt; Maybe Article -&gt; ActionT TL.Text IO () updateArticle pool Nothing = return () updateArticle pool (Just (Article id title bodyText)) = do      liftIO $ execSqlT pool [title, bodyText, (TL.decodeUtf8 $ BL.pack $ show id)]                             &quot;UPDATE article SET title=?, bodyText=? WHERE id=?&quot;      return ()  deleteArticle :: Pool Connection -&gt; TL.Text -&gt; ActionT TL.Text IO () deleteArticle pool id = do      liftIO $ execSqlT pool [id] &quot;DELETE FROM article WHERE id=?&quot;      return () <\/code><\/pre>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 insertArticle \u0438 updateArticle. \u041e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 Maybe Article \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\/\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0411\u0414. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u0442\u044c \u044d\u0442\u043e\u0442 Maybe Article?<\/p>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c Article, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 JSON, \u0432 \u0442\u0435\u043b\u0435 PUT- \u0438\u043b\u0438 POST- \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Article \u0432- \u0438 \u0438\u0437- JSON:<\/p>\n<pre><code class=\"haskell\">instance FromJSON Article where      parseJSON (Object v) = Article &lt;$&gt;                             v .:? &quot;id&quot; .!= 0 &lt;*&gt;                             v .:  &quot;title&quot;       &lt;*&gt;                             v .:  &quot;bodyText&quot;  instance ToJSON Article where      toJSON (Article id title bodyText) =          object [&quot;id&quot; .= id,                      &quot;title&quot; .= title,                      &quot;bodyText&quot; .= bodyText] <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 JSON \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 aeson, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0435\u0439 \u2014 <a href=\"http:\/\/ruhaskell.org\/posts\/packages\/2015\/02\/03\/aeson-hello-world.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043f\u0440\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0435 id \u2014 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435, \u0438 \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441 JSON, \u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 0. \u041f\u043e\u043b\u044f id \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 Article, \u0442.\u043a. id \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0430\u043c\u0430 \u0411\u0414. \u041d\u043e id \u0431\u0443\u0434\u0435\u0442 \u0432 update-\u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b Main.hs \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u0437 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 param:<\/p>\n<pre><code class=\"haskell\">param :: Parsable a =&gt; TL.Text -&gt; ActionM a <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 body:<\/p>\n<pre><code class=\"haskell\">body :: ActionM Data.ByteString.Lazy.Internal.ByteString <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c Maybe Article<\/p>\n<pre><code class=\"haskell\">getArticleParam :: ActionT TL.Text IO (Maybe Article) getArticleParam = do b &lt;- body                      return $ (decode b :: Maybe Article)                      where makeArticle s = &quot;&quot; <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435: \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 Views.hs \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"haskell\">articlesList :: [Article] -&gt; ActionM () articlesList articles = json articles  viewArticle :: Maybe Article -&gt; ActionM () viewArticle Nothing = json () viewArticle (Just article) = json article  createdArticle :: Maybe Article -&gt; ActionM () createdArticle article = json ()  updatedArticle :: Maybe Article -&gt; ActionM () updatedArticle article = json ()  deletedArticle :: TL.Text -&gt; ActionM () deletedArticle id = json () <\/code><\/pre>\n<h4>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h4>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u043e\u0443\u0442\u0431\u0443\u043a Samsung 700Z c 8\u0413\u0431 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u044f\u0434\u0435\u0440\u043d\u044b\u043c Intel Core i7.  <\/p>\n<ul>\n<li>1000 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 PUT-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 article.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 40 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 25 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.  <\/li>\n<li>100 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e 100 PUT-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 1248 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 80 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u043d\u0443\u0434\u0443.  <\/li>\n<li>100 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e 1000 GET-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0445 10 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 article.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 165 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 600 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.  <\/li>\n<\/ul>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0445\u043e\u0442\u044c \u0441 \u0447\u0435\u043c-\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c, \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java 7 \u0438 Spring 4 \u0441 \u0432\u0435\u0431\u0441\u0432\u0435\u0440\u0432\u0435\u0440\u043e\u043c Tomcat 7 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0446\u0438\u0444\u0440\u044b.  <\/p>\n<ul>\n<li>1000 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 PUT-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 article.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 51 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430, \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 19-20 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.  <\/li>\n<li>100 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e 100 PUT-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 104 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 960 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u043d\u0443\u0434\u0443.  <\/li>\n<li>100 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e 1000 GET-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0445 10 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 article.<br \/>  \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430: 26 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 3800 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0432 Haskell, \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e <a href=\"https:\/\/github.com\/dbushenko\/scotty-blog\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 CRUD-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 Article. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 JSON REST-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 basic authentication \u043d\u0430 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0445. \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0421\u0423\u0411\u0414 MySQL, \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0451\u043d \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u0441\u0435\u0441\u0441\u0438\u0438, \u0435\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e stateless-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0430\u0431\u043e\u0442\u043a\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/249183\/ , http:\/\/eax.me\/micro-service-architecture\/\">\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439<\/a> \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. <\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Haskell \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 JSON REST-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c: \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u0442.\u043a. \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041c\u0438\u043d\u0443\u0441\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Haskell \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0430 Java.             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/257491\/\"> http:\/\/habrahabr.ru\/post\/257491\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043b \u043e\u0442 \u044f\u0437\u044b\u043a\u043e\u0432 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u043e-\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435. Haskell \u043f\u0440\u0438\u0433\u043b\u044f\u043d\u0443\u043b\u0441\u044f \u043c\u043d\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u043e\u0439 \u043a\u043e\u0434\u0430 \u0438 \u0431\u0435\u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u043d\u044b\u043c \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u042f \u0437\u0430\u043b\u043f\u043e\u043c \u043f\u0440\u043e\u0433\u043b\u043e\u0442\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043d\u0438\u0436\u0435\u043a \u043f\u043e Haskell \u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0443\u0436\u0435 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c.<\/p>\n<p>  \u0418 \u0442\u0443\u0442-\u0442\u043e \u043c\u0435\u043d\u044f \u0436\u0434\u0430\u043b\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u044f \u043d\u0435 \u0431\u044b\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 hello world-a. \u0422.\u0435. \u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u0435\u0431\u0435, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0442\u0438\u043f\u0430 find \u0438\u043b\u0438 \u0432\u0440\u043e\u0434\u0435 \u0442\u043e\u0433\u043e, \u2014 \u043d\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430 \u0441 IO \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u043b\u0430 \u0432\u0441\u0435 \u043c\u043e\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f Haskell \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043c\u043d\u043e\u0433\u043e, \u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0438\u043c \u043f\u043e\u0447\u0442\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442\u0443. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e.<\/p>\n<p>  \u0421\u0438\u043c\u043f\u0442\u043e\u043c\u044b \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u0434\u0438\u0430\u0433\u043d\u043e\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438. \u0410 \u0434\u043b\u044f Haskell \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e, \u0442.\u043a. \u044f\u0437\u044b\u043a \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439. \u0414\u0430\u0436\u0435 \u0442\u043e, \u0447\u0442\u043e \u044f \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u044e Clojure, \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u0442.\u043a. Clojure \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Haskell \u2014 \u043d\u0430 \u0438\u0445 \u0442\u0438\u043f\u0430\u0445.<\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0432 Haskell. \u041f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0436 \u0431\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c desktop- \u0438\u043b\u0438 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e \u0445\u0430\u0441\u043a\u0435\u043b\u0438\u0441\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Haskell \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 Haskell, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043e\u0439\u0442\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u044b\u0445: \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <a href=\"https:\/\/github.com\/dbushenko\/scotty-blog\">\u0437\u0434\u0435\u0441\u044c<\/a>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256780","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256780"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256780\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}