{"id":374093,"date":"2024-05-21T05:51:53","date_gmt":"2024-05-21T05:51:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=374093"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=374093","title":{"rendered":"<span>\u041c\u0443\u043b\u044c\u0442\u0438\u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 (\u043c\u0443\u043b\u044c\u0442\u0438\u0441\u0430\u0439\u0442) \u043d\u0430 NextJS<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u042f frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u0441\u0435\u0431\u0435, \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u043b\u044e \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 500-1000 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0438 5-10 \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u0432 \u0441\u0430\u0439\u0442\u043e\u0432, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>domain.com, domain-[city].com, domain-[subproduct]-[city].com &#8212; &#171;\u0441\u0435\u0442\u043a\u0430&#187; 1<\/p>\n<\/li>\n<li>\n<p>domain2.com, domain2-[city].com, domain2-[anything]-[city].com &#8212; &#171;\u0441\u0435\u0442\u043a\u0430&#187; 2<\/p>\n<\/li>\n<li>\n<p>4,5&#8230;<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u0430 &#171;\u043e\u0434\u043d\u0430&#187; \u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u0411\u0414 \u0440\u0430\u0437\u043d\u044b\u0435. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 &#171;\u0441\u0435\u0442\u043a\u0438&#187; \u043e\u0434\u0438\u043d \u0434\u0438\u0437\u0430\u0439\u043d. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0435 \u0441\u0432\u043e\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\/\u0442\u043e\u0432\u0430\u0440\u043e\u0432\/\u0443\u0441\u043b\u0443\u0433 \u0438 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0432. \u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (SSG + ISR).<\/p>\n<p>\u0418\u0437-\u0437\u0430 \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043e\u0442 SEO\u0448\u043d\u0438\u043a\u043e\u0432, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. <\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b NextJS (Pages router). \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c domain.com\/[firstLevel] \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438 \u0442\u043e\u0432\u0430\u0440\/\u0443\u0441\u043b\u0443\u0433\u0430, \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0442\u043e\u0432\u0430\u0440\u0430\/\u0443\u0441\u043b\u0443\u0433\u0438, \u0438 \u0438\u043d\u0444\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0438 \u043b\u044e\u0431\u0430\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 &#8212; \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441 \u0431\u044d\u043a\u0430 \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. <\/p>\n<p>&#8212; \u0412 <strong>\u043f\u0430\u043f\u043a\u0435 \/pages<\/strong> \u0441\u043e\u0437\u0434\u0430\u043b <\/p>\n<ul>\n<li>\n<p>[&#8230;slug].tsx<\/p>\n<\/li>\n<li>\n<p>\u043f\u0430\u043f\u043a\u0443 admin<\/p>\n<ul>\n<li>\n<p>[adminFoldersAndRoutes] &#8212; \u0432 \u0440\u0435\u0430\u043b\u0435 \u043d\u0435 \u043e\u0434\u0438\u043d \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0443\u0442\u044c, \u0430 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043f\u043e\u043a \u0438 \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0443\u0434\u0430\u043b\u0438\u043b index.tsx<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p>&#8212; \u0412 <strong>next.config.js<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 getStaticProps \u0432 [&#8230;slug].tsx:<\/p>\n<pre><code class=\"javascript\">async rewrites() {     return [       {         source: '\/admin\/:path*',         destination: '\/admin\/:path*',       },       {         has: [           {             type: 'host',             value: '(?&lt;host>.*)',           },         ],         source: '\/',         destination: '\/:host',       },       {         has: [           {             type: 'host',             value: '(?&lt;host>.*)',           },         ],         source: '\/:path*',         destination: '\/:host\/:path*',       },     ];   },<\/code><\/pre>\n<p>&#8212; \u0412 <strong>getStaticProps \u0432 [&#8230;slug].tsx:<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 context \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 <strong>ctx.params.slug \u0438 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/strong>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e React query \u0434\u0435\u043b\u0430\u0435\u043c <\/p>\n<pre><code class=\"javascript\"> queryClient.prefetchQuery({         queryFn: () => getPageData({ baseApi, url }),         queryKey: [QUERY_KEY_FETCH_PAGE_DATA, { baseApi, url }]       }),<\/code><\/pre>\n<p><strong>baseApi<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 <strong>getStaticProps <\/strong>\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c domainData, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u043e\u043c\u0435\u043d\u0443 (\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b, \u0430\u0434\u0440\u0435\u0441\u0430, \u0438\u043d\u0444\u043e \u0434\u043b\u044f \u0448\u0430\u043f\u043a\u0438\/\u0444\u0443\u0442\u0435\u0440\u0430, \u0438\u043d\u0444\u043e \u0434\u043e\u043c\u0435\u043d\u0430: \u0430\u043f\u0438 \u0438 \u0442\u0434&#8230;) \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u044d\u0448\u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0430\u0434\u043e<\/p>\n<p><strong>\u0412 getStaticPaths:<\/strong><\/p>\n<pre><code class=\"javascript\">export const getStaticPaths = async (): Promise&lt;any> => ({   fallback: 'blocking',   paths: [] })<\/code><\/pre>\n<p>&#8212;<strong> \u041f\u0435\u0440\u0435\u0434\u0430\u044e baseApi \u0432\u043d\u0438\u0437 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/strong> \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (DynamicPage), \u0442\u0430\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 pageData, \u0434\u043e\u0441\u0442\u0430\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442:<\/p>\n<ul>\n<li>\n<p>\u0442\u0438\u043f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (switch\/case)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043b\u0435\u0431\u043d\u044b\u0435 \u043a\u0440\u043e\u0448\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 (\u0432\u044b\u0432\u043e\u0434 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0415\u041e<\/p>\n<\/li>\n<\/ul>\n<p>&#8212;<strong> \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043f\u043e CSS (\u0448\u0440\u0438\u0444\u0442\u044b, \u0446\u0432\u0435\u0442\u0430) \u0434\u0435\u043b\u0430\u044e \u0447\u0435\u0440\u0435\u0437 &lt;style><\/strong> \u0432 DynamicPage \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0438\u0437 domainData.<\/p>\n<p>&#8212; <strong>\u0412 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0430\u0445: \u0442\u043e\u0432\u0430\u0440\u044b, \u0443\u0441\u043b\u0443\u0433\u0438, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432\/\u0443\u0441\u043b\u0443\u0433, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0431\u0440\u0435\u043d\u0434\u044b \u0438 \u0432\u0441\u0451, \u0432\u0441\u0451, \u0432\u0441\u0451! \u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0421\u0415\u041e. \u0412 \u0438\u0442\u043e\u0433\u0435 &#8212; \u044d\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043f\u043e\u043b\u0435\u0439 \u0444\u043e\u0440\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0410\u0434\u043c\u0438\u043d\u043a\u0430 \u0432\u0441\u044f \u043d\u0430 <strong>getServerSideProps \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043d\u0430 CSR. <\/strong>\u041d\u0430 \u043b\u044e\u0431\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <strong>PUT\/PATCH\/DELETE\/POST \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u0435\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0441 \u0431\u044d\u043a\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 api NextJS:<\/strong><\/p>\n<pre><code class=\"javascript\">\/** \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 *\/ export default async function handler (req: NextApiRequest, res:NextApiResponse): Promise&lt;void> {   if (req?.method !== 'POST') {     return res.status(405).json({ message: '\u041c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d' })   }    try {     if (req?.body?.secret !== process.env.REVALIDATE_TOKEN) {       return res.status(401).json({ message: '\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d' })     }      if (!Array.isArray(req.body.url)) {       return res.status(400).json({ message: '\u041d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0443\u0440\u043b' })     }      \/** \u043f\u0440\u043e\u043c\u0438\u0441\u044b *\/     const revalidatePromises = req?.body?.url?.map(async (url: string) => res.revalidate(url))      \/** \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b *\/     const results = await Promise.allSettled(revalidatePromises)      \/** \u043a\u043e\u043b-\u0432\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 *\/     const successfulRevalidations = results.filter(result => result.status === 'fulfilled').length      return res.json({ revalidated: true, successfulRevalidations })   } catch (err) {     return res.status(500).send('\u041e\u0448\u0438\u0431\u043a\u0430 \u0440\u0435\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438\u0437 \u0445\u044d\u043d\u0434\u043b\u0435\u0440\u0430')   } }<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c baseApi. <\/p>\n<p>\u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u0438\u0448\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e, \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u044e \u043d\u0435 \u0442\u0430\u043a, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0440\u0435\u0433\u0435\u043d\u0438\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0412\u0430\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0446\u0435\u043d\u0435 \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0434\u0435\u043b\u0430\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c\u0438.<\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043a\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043c\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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\/articles\/808861\/\"> https:\/\/habr.com\/ru\/articles\/808861\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u042f frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u0441\u0435\u0431\u0435, \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u043b\u044e \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 500-1000 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0438 5-10 \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u0432 \u0441\u0430\u0439\u0442\u043e\u0432, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>domain.com, domain-[city].com, domain-[subproduct]-[city].com &#8212; &#171;\u0441\u0435\u0442\u043a\u0430&#187; 1<\/p>\n<\/li>\n<li>\n<p>domain2.com, domain2-[city].com, domain2-[anything]-[city].com &#8212; &#171;\u0441\u0435\u0442\u043a\u0430&#187; 2<\/p>\n<\/li>\n<li>\n<p>4,5&#8230;<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u0430 &#171;\u043e\u0434\u043d\u0430&#187; \u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u0411\u0414 \u0440\u0430\u0437\u043d\u044b\u0435. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 &#171;\u0441\u0435\u0442\u043a\u0438&#187; \u043e\u0434\u0438\u043d \u0434\u0438\u0437\u0430\u0439\u043d. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0435 \u0441\u0432\u043e\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\/\u0442\u043e\u0432\u0430\u0440\u043e\u0432\/\u0443\u0441\u043b\u0443\u0433 \u0438 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0432. \u0412\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (SSG + ISR).<\/p>\n<p>\u0418\u0437-\u0437\u0430 \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043e\u0442 SEO\u0448\u043d\u0438\u043a\u043e\u0432, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. <\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b NextJS (Pages router). \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c domain.com\/[firstLevel] \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438 \u0442\u043e\u0432\u0430\u0440\/\u0443\u0441\u043b\u0443\u0433\u0430, \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0442\u043e\u0432\u0430\u0440\u0430\/\u0443\u0441\u043b\u0443\u0433\u0438, \u0438 \u0438\u043d\u0444\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0438 \u043b\u044e\u0431\u0430\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 &#8212; \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441 \u0431\u044d\u043a\u0430 \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. <\/p>\n<p>&#8212; \u0412 <strong>\u043f\u0430\u043f\u043a\u0435 \/pages<\/strong> \u0441\u043e\u0437\u0434\u0430\u043b <\/p>\n<ul>\n<li>\n<p>[&#8230;slug].tsx<\/p>\n<\/li>\n<li>\n<p>\u043f\u0430\u043f\u043a\u0443 admin<\/p>\n<ul>\n<li>\n<p>[adminFoldersAndRoutes] &#8212; \u0432 \u0440\u0435\u0430\u043b\u0435 \u043d\u0435 \u043e\u0434\u0438\u043d \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0443\u0442\u044c, \u0430 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043f\u043e\u043a \u0438 \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0443\u0434\u0430\u043b\u0438\u043b index.tsx<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p>&#8212; \u0412 <strong>next.config.js<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 getStaticProps \u0432 [&#8230;slug].tsx:<\/p>\n<pre><code class=\"javascript\">async rewrites() {     return [       {         source: '\/admin\/:path*',         destination: '\/admin\/:path*',       },       {         has: [           {             type: 'host',             value: '(?&lt;host>.*)',           },         ],         source: '\/',         destination: '\/:host',       },       {         has: [           {             type: 'host',             value: '(?&lt;host>.*)',           },         ],         source: '\/:path*',         destination: '\/:host\/:path*',       },     ];   },<\/code><\/pre>\n<p>&#8212; \u0412 <strong>getStaticProps \u0432 [&#8230;slug].tsx:<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 context \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 <strong>ctx.params.slug \u0438 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/strong>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e React query \u0434\u0435\u043b\u0430\u0435\u043c <\/p>\n<pre><code class=\"javascript\"> queryClient.prefetchQuery({         queryFn: () => getPageData({ baseApi, url }),         queryKey: [QUERY_KEY_FETCH_PAGE_DATA, { baseApi, url }]       }),<\/code><\/pre>\n<p><strong>baseApi<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 <strong>getStaticProps <\/strong>\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c domainData, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u043e\u043c\u0435\u043d\u0443 (\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b, \u0430\u0434\u0440\u0435\u0441\u0430, \u0438\u043d\u0444\u043e \u0434\u043b\u044f \u0448\u0430\u043f\u043a\u0438\/\u0444\u0443\u0442\u0435\u0440\u0430, \u0438\u043d\u0444\u043e \u0434\u043e\u043c\u0435\u043d\u0430: \u0430\u043f\u0438 \u0438 \u0442\u0434&#8230;) \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u044d\u0448\u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0430\u0434\u043e<\/p>\n<p><strong>\u0412 getStaticPaths:<\/strong><\/p>\n<pre><code class=\"javascript\">export const getStaticPaths = async (): Promise&lt;any> => ({   fallback: 'blocking',   paths: [] })<\/code><\/pre>\n<p>&#8212;<strong> \u041f\u0435\u0440\u0435\u0434\u0430\u044e baseApi \u0432\u043d\u0438\u0437 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/strong> \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (DynamicPage), \u0442\u0430\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 pageData, \u0434\u043e\u0441\u0442\u0430\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442:<\/p>\n<ul>\n<li>\n<p>\u0442\u0438\u043f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (switch\/case)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043b\u0435\u0431\u043d\u044b\u0435 \u043a\u0440\u043e\u0448\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 (\u0432\u044b\u0432\u043e\u0434 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0415\u041e<\/p>\n<\/li>\n<\/ul>\n<p>&#8212;<strong> \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043f\u043e CSS (\u0448\u0440\u0438\u0444\u0442\u044b, \u0446\u0432\u0435\u0442\u0430) \u0434\u0435\u043b\u0430\u044e \u0447\u0435\u0440\u0435\u0437 &lt;style><\/strong> \u0432 DynamicPage \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0438\u0437 domainData.<\/p>\n<p>&#8212; <strong>\u0412 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0430\u0445: \u0442\u043e\u0432\u0430\u0440\u044b, \u0443\u0441\u043b\u0443\u0433\u0438, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432\/\u0443\u0441\u043b\u0443\u0433, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0431\u0440\u0435\u043d\u0434\u044b \u0438 \u0432\u0441\u0451, \u0432\u0441\u0451, \u0432\u0441\u0451! \u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0421\u0415\u041e. \u0412 \u0438\u0442\u043e\u0433\u0435 &#8212; \u044d\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043f\u043e\u043b\u0435\u0439 \u0444\u043e\u0440\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0410\u0434\u043c\u0438\u043d\u043a\u0430 \u0432\u0441\u044f \u043d\u0430 <strong>getServerSideProps \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043d\u0430 CSR. <\/strong>\u041d\u0430 \u043b\u044e\u0431\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <strong>PUT\/PATCH\/DELETE\/POST \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u0435\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0441 \u0431\u044d\u043a\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 api NextJS:<\/strong><\/p>\n<pre><code class=\"javascript\">\/** \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 *\/ export default async function handler (req: NextApiRequest, res:NextApiResponse): Promise&lt;void> {   if (req?.method !== 'POST') {     return res.status(405).json({ message: '\u041c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d' })   }    try {     if (req?.body?.secret !== process.env.REVALIDATE_TOKEN) {       return res.status(401).json({ message: '\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d' })     }      if (!Array.isArray(req.body.url)) {       return res.status(400).json({ message: '\u041d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0443\u0440\u043b' })     }      \/** \u043f\u0440\u043e\u043c\u0438\u0441\u044b *\/     const revalidatePromises = req?.body?.url?.map(async (url: string) => res.revalidate(url))      \/** \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b *\/     const results = await Promise.allSettled(revalidatePromises)      \/** \u043a\u043e\u043b-\u0432\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 *\/     const successfulRevalidations = results.filter(result => result.status === 'fulfilled').length      return res.json({ revalidated: true, successfulRevalidations })   } catch (err) {     return res.status(500).send('\u041e\u0448\u0438\u0431\u043a\u0430 \u0440\u0435\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438\u0437 \u0445\u044d\u043d\u0434\u043b\u0435\u0440\u0430')   } }<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c baseApi. <\/p>\n<p>\u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u0438\u0448\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e, \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u044e \u043d\u0435 \u0442\u0430\u043a, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0440\u0435\u0433\u0435\u043d\u0438\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0412\u0430\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0446\u0435\u043d\u0435 \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0434\u0435\u043b\u0430\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c\u0438.<\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043a\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043c\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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\/articles\/808861\/\"> https:\/\/habr.com\/ru\/articles\/808861\/<\/a><br \/><\/br><\/br><\/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-374093","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374093","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=374093"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374093\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}