{"id":292285,"date":"2019-07-19T09:00:44","date_gmt":"2019-07-19T09:00:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=292285"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=292285","title":{"rendered":"Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 4: \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043d\u0430 Flask \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTTP"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<blockquote><p><a href=\"https:\/\/habr.com\/ru\/post\/456474\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 0: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Svelte \u0438 React<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/458752\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 1: Svelte \u0438 Canvas 2D<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/459630\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 2: Undo\/Redo \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/459906\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 3: Undo\/Redo \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434<\/a><br \/>  Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 4: \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043d\u0430 Flask \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTTP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430<\/p><\/blockquote>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Svelte \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/459906\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043d\u0430 Flask \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 <strong>Flask<\/strong> \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 <strong>Boost.Beast<\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <strong>Flask<\/strong>. \u041d\u0435 \u043e\u0433\u043e\u0440\u0447\u0430\u0439\u0442\u0435\u0441\u044c, \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <strong>Boost.Beast<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h6 id=\"ustanovka-proekta\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h6>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e docker \u0438 docker-compose \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. <\/p>\n<p>  <\/p>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/nomhoi\/tic-tac-toe-part4.git<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cd tic-tac-toe-part4 docker-compose up -d<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cd front npm install npm run-script build<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u043e\u0443\u0437\u0435\u0440 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost\">http:\/\/localhost<\/a>. \u041d\u0430 Windows \u043c\u0430\u0448\u0438\u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u043c IP docker \u043c\u0430\u0448\u0438\u043d\u044b, \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e <a href=\"http:\/\/192.168.99.100\">http:\/\/192.168.99.100<\/a>. <\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043a\u043d\u043e\u043f\u043a\u0430 <strong>Get random number<\/strong>. \u041f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u044d\u0442\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"http:\/\/localhost\/number\">http:\/\/localhost\/number<\/a> \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043d\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0 \u0434\u043e 8 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u042d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u043a\u0430 \u043c\u044b\u0448\u043a\u043e\u0439 \u043f\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <strong>history.push<\/strong>, \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0435\u0441\u0442\u0438\u043a \u0438\u043b\u0438 \u043d\u043e\u043b\u0438\u043a. \u0415\u0441\u043b\u0438 \u043a\u043b\u0435\u0442\u043a\u0430 \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u0442\u0430, \u0442\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <strong>busy<\/strong>.<\/p>\n<p>  <\/p>\n<h6 id=\"docker-konteynery\">Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b<\/h6>\n<p>  <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c <a href=\"https:\/\/habr.com\/ru\/post\/459972\/\">\u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e docker \u0438 docker-compose<\/a> \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f. \u0417\u0434\u0435\u0441\u044c \u0443\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <strong>docker-compose.yml<\/strong> \u0444\u0430\u0439\u043b. \u0418\u043c\u0435\u0435\u043c \u0434\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: <strong>nginx<\/strong> \u0438 <strong>flask<\/strong>.<\/p>\n<p>  <\/p>\n<p><strong>docker-compose.yml:<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">version: \"3.5\" services:   nginx:      image: nginx:alpine     container_name: nginx     volumes:       - .\/front\/public:\/usr\/share\/nginx\/html       - .\/default.conf:\/etc\/nginx\/conf.d\/default.conf:ro     ports:       - \"80:80\"     depends_on:       - flask     networks:       - backend    flask:     build:       context: flask\/       dockerfile: Dockerfile     ports:       - \"5000:5000\"     volumes:       - .\/flask:\/code     environment:       FLASK_ENV: development     networks:       - backend  networks:   backend:     name: backend<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 <strong>nginx<\/strong> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 <strong>nginx<\/strong>, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 <strong>flask<\/strong> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <strong>Flask<\/strong> \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043d\u0430\u0448\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  <\/p>\n<h6 id=\"frontend\">\u0424\u0440\u043e\u043d\u0442\u0435\u043d\u0434<\/h6>\n<p>  <\/p>\n<p>\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0437\u044f\u043b\u0438 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/459906\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 <strong>front<\/strong>. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>Dispatcher<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c.<\/p>\n<p>  <\/p>\n<p><strong>Dispatcher.svelte:<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;script&gt;     import { history, status } from '.\/stores.js';     import { Command } from '.\/helpers.js';      let promise = null;      async function getRandomNumber() {         const res = await fetch(`number`);         const text = await res.text();          if (res.ok) {             let i = parseInt(text);             if ($status === 1 || $history.state.squares[i])                 return text + ' - busy';              history.push(new Command($history.state, i));              return text;         } else {             throw new Error(text);         }     }      function handleClick() {         promise = getRandomNumber();     }      \/\/setInterval(handleClick, 500); &lt;\/script&gt;  {#if $status &gt; 0}     &lt;button disabled&gt;         Get random number     &lt;\/button&gt; {:else}     &lt;button on:click={handleClick}&gt;         Get random number     &lt;\/button&gt; {\/if}  {#await promise}     &lt;p&gt;...\u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435&lt;\/p&gt; {:then number}     &lt;p&gt;Respond from backend: {number}&lt;\/p&gt; {:catch error}     &lt;p style=\"color: red\"&gt;{error.message}&lt;\/p&gt; {\/await}<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0437\u044f\u0442 \u0438\u0437 <a href=\"https:\/\/ru.svelte.dev\/tutorial\/await-blocks\">\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a>. \u041f\u043e \u043a\u043b\u0438\u043a\u0443 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 <strong>Get random number<\/strong> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>getRandomNumber()<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e URI <strong><a href=\"http:\/\/localhost\/number\">http:\/\/localhost\/number<\/a><\/strong>, nginx \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u0443, \u0438 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u042d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e.<br \/>  \u0410\u0434\u0440\u0435\u0441 <strong><a href=\"http:\/\/localhost\/number\">http:\/\/localhost\/number<\/a><\/strong> \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 <strong>nginx<\/strong> \u0432 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong>default.conf<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">location \/number {     proxy_pass   http:\/\/flask:5000; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044d\u043a\u0435\u043d\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<h6 id=\"bekend\">\u0411\u044d\u043a\u0435\u043d\u0434<\/h6>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <strong>flask<\/strong> \u0432\u0437\u044f\u0442\u0430 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/docs.docker.com\/compose\/gettingstarted\/\">https:\/\/docs.docker.com\/compose\/gettingstarted\/<\/a>. <\/p>\n<p>  <\/p>\n<p><strong>App.py:<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from flask import Flask from random import randrange  app = Flask(__name__)  @app.route('\/number') def number():     return str(randrange(9))<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 <strong>\/number<\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>number()<\/strong>. \u041f\u043e \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 0 \u0434\u043e 8 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<h6 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h6>\n<p>  <\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u041d\u043e \u0442\u0430\u043a\u0443\u044e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u043c\u043e\u0436\u043d\u043e \u0438 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u0438\u0433\u0440\u043e\u043a \u0438\u0433\u0440\u0430\u0435\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0449\u0438\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0433\u0434\u0430 \u0438\u0433\u0440\u043e\u043a \u0438\u0433\u0440\u0430\u0435\u0442 \u0441 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0433\u0435\u043d\u0442\u043e\u043c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0430 \u043d\u0435 \u0432 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<h6 id=\"repozitoriy-na-github\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 GitHub<\/h6>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/nomhoi\/tic-tac-toe-part4\">https:\/\/github.com\/nomhoi\/tic-tac-toe-part4<\/a><\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/460621\/\"> https:\/\/habr.com\/ru\/post\/460621\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<blockquote><p><a href=\"https:\/\/habr.com\/ru\/post\/456474\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 0: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Svelte \u0438 React<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/458752\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 1: Svelte \u0438 Canvas 2D<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/459630\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 2: Undo\/Redo \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/459906\/\">Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 3: Undo\/Redo \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434<\/a><br \/>  Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 4: \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043d\u0430 Flask \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTTP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430<\/p><\/blockquote>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Svelte \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/459906\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043d\u0430 Flask \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 <strong>Flask<\/strong> \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 <strong>Boost.Beast<\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <strong>Flask<\/strong>. \u041d\u0435 \u043e\u0433\u043e\u0440\u0447\u0430\u0439\u0442\u0435\u0441\u044c, \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <strong>Boost.Beast<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.<\/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-292285","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292285","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=292285"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292285\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}