{"id":337886,"date":"2022-09-03T21:00:07","date_gmt":"2022-09-03T21:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337886"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337886","title":{"rendered":"<span>GridComponent. \u0427\u0430\u0441\u0442\u044c II. \u041a\u043e\u0442\u0438\u043a\u0438, NestJS \u0438 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043e Postman<\/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>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0434\u043d\u044f, \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435!<\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0431\u0435\u0449\u0430\u043b, \u0432 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/post\/676622\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0433\u0440\u0438\u0434-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u043f\u0438\u0448\u0443 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 backend \u0447\u0430\u0441\u0442\u0438 \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043a\u0430\u043a NestJS, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f backend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u043a\u0440\u0443\u0442\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443, \u0441\u043a\u043e\u0440\u0435\u0435 \u2013 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0435\u0433\u043e \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u043c. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 NestJS, \u0430 \u043d\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastApi <\/a>(Python), <a href=\"https:\/\/spring.io\/projects\/spring-boot\" rel=\"noopener noreferrer nofollow\">Spring Boot<\/a> (Java) \u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u043e\u0434\u043d\u044b\u0439 backend \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c? \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043a\u043e\u0442\u0438\u043a\u0438! <\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u0431\u0437\u043e\u0440 \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u043e\u0442 NestJS<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d55\/3ac\/8cd\/d553ac8cd53275da9f29a9d66cd0072c.png\" alt=\"\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\" title=\"\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\" width=\"670\" height=\"579\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d55\/3ac\/8cd\/d553ac8cd53275da9f29a9d66cd0072c.png\"\/><figcaption>\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/566\/2b1\/d73\/5662b1d733a509a07a70bbe9a218ee2c.png\" alt=\"\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\" title=\"\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\" width=\"551\" height=\"276\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/566\/2b1\/d73\/5662b1d733a509a07a70bbe9a218ee2c.png\"\/><figcaption>\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/678\/4bf\/3c7\/6784bf3c7e1f95566f7a42ac4fa50db9.png\" alt=\"Controllers\" title=\"Controllers\" width=\"523\" height=\"272\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/678\/4bf\/3c7\/6784bf3c7e1f95566f7a42ac4fa50db9.png\"\/><figcaption>Controllers<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d4\/e5f\/a8d\/1d4e5fa8d0053c94a2176e3ab76736dd.png\" alt=\"\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u044b \u043f\u043e NestJS\" title=\"\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u044b \u043f\u043e NestJS\" width=\"892\" height=\"706\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d4\/e5f\/a8d\/1d4e5fa8d0053c94a2176e3ab76736dd.png\"\/><figcaption>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u044b \u043f\u043e NestJS<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/128\/b77\/618\/128b776185753814dfe03868e02d4bf6.png\" alt=\"\u0423\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043d\u044e \u0433\u0434\u0435\" title=\"\u0423\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043d\u044e \u0433\u0434\u0435\" width=\"586\" height=\"464\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/128\/b77\/618\/128b776185753814dfe03868e02d4bf6.png\"\/><figcaption>\u0423\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043d\u044e \u0433\u0434\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/552\/a3c\/ada\/552a3cadac7ff0cf7b23c9fbdca73dda.png\" alt=\"\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0441\u0442\u0443\u043b\u0435\" title=\"\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0441\u0442\u0443\u043b\u0435\" width=\"540\" height=\"475\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/552\/a3c\/ada\/552a3cadac7ff0cf7b23c9fbdca73dda.png\"\/><figcaption>\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0441\u0442\u0443\u043b\u0435<\/figcaption><\/figure>\n<p>P.S. \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0449\u0435 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0442\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435. <br \/>\u041d\u0430\u0439\u0434\u0435\u0442\u0435 &#8212; \u043a\u0438\u0434\u0430\u0439\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u0428\u0443\u0447\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0442\u044f \u043a\u043e\u0442\u044b \u0432 <a href=\"https:\/\/nestjs.com\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0447\u0443\u0436\u043e\u043c <s>\u0433\u043e\u0432\u043d\u043e<\/s> \u043a\u043e\u0434\u0435, \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0442.\u043f. \u041d\u0443 \u0438 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u2014 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0431\u0440\u0435\u043b \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u0438\u043c\u0435\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e (\u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043b\u0435\u043d\u044c <a href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/663234\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438<\/a> \u0435\u0435 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439) \u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 RESTfull \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u043e\u0431\u0437\u043e\u0440\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/company\/domclick\/blog\/567816\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u043b\u0443!<\/p>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434 Linux (Ubuntu). \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c NodeJS, npm (\u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/676622\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>) \u043d\u0443 \u0438 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u2014 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0442\u0432\u043e\u0440\u0438\u0442\u044c!<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#install-nestcli\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NestJS \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#hot-reload-setup\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Hot Reload<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#sqlite-setup\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#document-module-creation\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#controller-and-service-creation\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#dto\" rel=\"noopener noreferrer nofollow\">Data Transfer Object (DTO)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#api-implementation\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f API. Dependency injection<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#postman\" rel=\"noopener noreferrer nofollow\">Postman. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c API \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0411\u0414<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#paging-sorting-filtering\" rel=\"noopener noreferrer nofollow\">\u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#cors\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0440\u043e\u043d\u0442 \u0438 \u0431\u044d\u043a. \u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. CORS<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#conclusion\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"install-nestcli\" id=\"install-nestcli\"><\/a><\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NestJS \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u2014 \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0434\u043b\u044f VueJS, \u0434\u043b\u044f NestJS \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u044f CLI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 <a href=\"https:\/\/docs.nestjs.com\/#installation\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI <\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>npm i -g @nestjs\/cli<\/code><\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/093\/2cd\/fc6\/0932cdfc6854beeee4803e7dfb38daca.png\" alt=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438\" title=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438\" width=\"748\" height=\"376\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/093\/2cd\/fc6\/0932cdfc6854beeee4803e7dfb38daca.png\"\/><figcaption>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438<\/figcaption><\/figure>\n<p>\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 9.0.0. \u0412\u044b\u0432\u043e\u0434 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0443 \u0412\u0430\u0441 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0442.\u043a. \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d nest \u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b.<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>nest new grid-component-backend<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0440\u0435\u0434\u0430 nest cli \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440. \u042f \u0432\u044b\u0431\u0435\u0440\u0443 npm (\u0438 \u0412\u0430\u043c \u0442\u043e\u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e) \u0438 \u0436\u043c\u0435\u043c Enter:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3c0\/e11\/9d0\/3c0e119d0facd961e3a6e3aad5b3b53d.png\" alt=\"\u0412\u044b\u0431\u043e\u0440 npm \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432\" title=\"\u0412\u044b\u0431\u043e\u0440 npm \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432\" width=\"1102\" height=\"472\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3c0\/e11\/9d0\/3c0e119d0facd961e3a6e3aad5b3b53d.png\"\/><figcaption>\u0412\u044b\u0431\u043e\u0440 npm \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/figcaption><\/figure>\n<p>\u0436\u0434\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aa1\/9b0\/055\/aa19b0055ffe55e67f14892500841475.png\" alt=\"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" title=\"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" width=\"529\" height=\"72\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa1\/9b0\/055\/aa19b0055ffe55e67f14892500841475.png\"\/><figcaption>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eba\/dd9\/b33\/ebadd9b33eae12364aef390021063ee5.png\" alt=\"\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 \u0434\u043e\u043d\u0430\u0442 =)\" title=\"\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 \u0434\u043e\u043d\u0430\u0442 =)\" width=\"665\" height=\"344\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eba\/dd9\/b33\/ebadd9b33eae12364aef390021063ee5.png\"\/><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 \u0434\u043e\u043d\u0430\u0442 =)<\/figcaption><\/figure>\n<p>P.S. \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u043e\u043d\u0430\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u043e \u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u0440\u043e\u043f\u0443\u0449\u0443 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 =)<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u2014  \u0432\u0441\u0435 \u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<code>cd grid-component-backend<\/code> \u0438 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 <code>npm run start<\/code>:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/99e\/b0c\/c64\/99eb0cc64f8afa55cd17e0811d933d34.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" width=\"994\" height=\"264\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99e\/b0c\/c64\/99eb0cc64f8afa55cd17e0811d933d34.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u0417\u0435\u043b\u0435\u043d\u0435\u043d\u044c\u043a\u0438\u0435 \u043b\u043e\u0433\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 http:\/\/127.0.0.1:3000 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aa1\/831\/31f\/aa183131f6fdb8e923b0fa399e21c9ce.png\" alt=\"Hello World \u043d\u0430 NestJS\" title=\"Hello World \u043d\u0430 NestJS\" width=\"571\" height=\"158\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa1\/831\/31f\/aa183131f6fdb8e923b0fa399e21c9ce.png\"\/><figcaption>Hello World \u043d\u0430 NestJS<\/figcaption><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 (Ctrl+C) \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 VS Code.<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0443\u044e <a href=\"https:\/\/www.sqlite.org\/index.html\" rel=\"noopener noreferrer nofollow\">sqlite<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"hot-reload-setup\" id=\"hot-reload-setup\"><\/a><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Hot Reload<\/h2>\n<p>Nest \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/docs.nestjs.com\/recipes\/hot-reload\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/a> \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\/\u0431\u0438\u043b\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0412\u044b \u043a\u0430\u043a \u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Nest CLI, \u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/b8795d66fc788bbbbed05856795c5d4d0b6f52d9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u043a\u0435\u0442\u044b<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm i --save-dev webpack-node-externals run-script-webpack-plugin webpack<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>webpack-hmr.config.js<\/strong> \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-daae7b65b9b41cd81aae4709dc7ea01dc706a918806efb5e9c64f460a5ba7afa\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b <strong>src\/main.ts<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3d\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p> \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>package.json<\/strong> <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/a> \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run start:dev<\/code> .<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c&#8230;\u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u044e\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Hot Reload<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f83\/e0a\/74a\/f83e0a74a3b33b170c411ac4675be052.png\" alt=\"\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\" title=\"\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\" width=\"990\" height=\"565\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f83\/e0a\/74a\/f83e0a74a3b33b170c411ac4675be052.png\"\/><figcaption>\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/figure>\n<p>\u0432\u0438\u0434\u0438\u043c\u043e \u043d\u0435 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u043b\u0430\u0434\u043a\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 webpack \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0438\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>webpack-hmr.config.js<\/strong>:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e46\/67b\/6da\/e4667b6da3320274b4ecf67e0619c470.png\" alt=\"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart\" title=\"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart\" width=\"728\" height=\"64\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e46\/67b\/6da\/e4667b6da3320274b4ecf67e0619c470.png\"\/><figcaption>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0438 \u0437\u043d\u0430\u0435\u0442 \u0441 \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u043b\u0435\u0447\u0438\u0442\u044c \u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p><a class=\"anchor\" name=\"sqlite-setup\" id=\"sqlite-setup\"><\/a><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite. \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.nestjs.com\/techniques\/database\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u2014 Nest \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 @nestjs\/typeorm \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f TypeORM \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414 sqlite c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm install --save @nestjs\/typeorm typeorm sqlite3<\/code> . \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>package.json<\/strong> \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u0438 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/8e44992422aeea287016ae7949b7d67c71c4c4cb#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0411\u0414. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 sqlite \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e:<\/p>\n<details class=\"spoiler\">\n<summary>app.module.ts<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"typescript\">import { Module } from '@nestjs\/common'; import { AppController } from '.\/app.controller'; import { AppService } from '.\/app.service'; import { TypeOrmModule } from '@nestjs\/typeorm'; import { DocumentsModule } from '.\/documents\/documents.module';  @Module({   imports: [     TypeOrmModule.forRoot({       type: 'sqlite',       database: '.\/test_db.sqlite',       synchronize: true,       autoLoadEntities: true,     }),      DocumentsModule  \/\/ \u0410 \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0430\u043c\u0438,                       \/\/ \u043e \u043d\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435    ],   controllers: [AppController],   providers: [AppService], }) export class AppModule { } <\/code><\/pre>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c (\u043a\u043b\u0430\u0441\u0441) TypeOrmModule, \u0432\u044b\u0437\u0432\u0430\u0432 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 forRoot() \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u0438\u043f\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0441\u043c. \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442):<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24f\/26b\/652\/24f26b6524e6457a4193944e45e8f50d.png\" alt=\"\u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 forRoot()\" title=\"\u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 forRoot()\" width=\"864\" height=\"97\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/24f\/26b\/652\/24f26b6524e6457a4193944e45e8f50d.png\"\/><figcaption>\u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 forRoot()<\/figcaption><\/figure>\n<p>\u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0411\u0414. <\/p>\n<p>\u0412 \u0441\u0430\u043c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 forRoot() \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0442\u0438\u043f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0421\u0423\u0411\u0414 (sqlite) \u0438 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 <strong>test_db.sqlite<\/strong> (\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 synchronize \u0438 <a href=\"https:\/\/docs.nestjs.com\/techniques\/database#auto-load-entities\" rel=\"noopener noreferrer nofollow\">autoLoadEntities<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/typeorm.io\/data-source-options\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"document-module-creation\" id=\"document-module-creation\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/h2>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 NestJS \u0438\u043c\u0435\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043c\u043d\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/domclick\/blog\/567816\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> (\u043e\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0412\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439).<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0444\u0430\u0439\u043b <strong>app.module.ts<\/strong>). \u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f Nest CLI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>nest g module documents:<\/code><\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/84b\/e43\/1e9\/84be431e9f296e478e1deda76302de4d.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f documents\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f documents\" width=\"776\" height=\"129\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84b\/e43\/1e9\/84be431e9f296e478e1deda76302de4d.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f documents<\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0440\u0438\u0441\u0443\u043d\u043a\u0430 \u2014 \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u0430\u043f\u043a\u0443 documents \u0432 \u043f\u0430\u043f\u043a\u0435 src, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0442\u0443\u0434\u0430 \u0444\u0430\u0439\u043b <strong>documents.module.ts<\/strong> \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>app.module.ts<\/strong>. \u0412\u043e\u0442 \u044d\u0442\u0438 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/2a6339319253ba03cec8f350d88f882ca6f95ad2\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <strong>src\/documents\/entities<\/strong> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u044f Document (\u0445\u043e\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430), \u0430 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u2014 \u0444\u0430\u0439\u043b <strong>document.entity.ts<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"typescript\">import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';  @Entity() export class Document {   @PrimaryGeneratedColumn()   id: Number;    @Column({ length: 100, unique: true })   cipher: String;    @Column()   createdOn: Date;    @Column()   inArchive: Boolean; } <\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b, \u044f \u0434\u0443\u043c\u0430\u044e \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0412\u0430\u043c \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0438\u0442\u044c <a href=\"https:\/\/typeorm.io\/entities\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0438 \u043f\u043e TypeORM<\/a> \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 =).<\/p>\n<p><a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/a04322c10264e32fa048a78c33da61e37817befb\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c<\/a> \u044d\u0442\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 document:<\/p>\n<pre><code class=\"typescript\">import { Module } from '@nestjs\/common'; import { TypeOrmModule } from '@nestjs\/typeorm'; import { Document } from '.\/entities\/document.entity';  @Module({     imports: [TypeOrmModule.forFeature([Document])], }) export class DocumentsModule {}<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 hot reload \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 <strong>test_db.sqlite<\/strong>.<\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0411\u0414 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 document \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0411\u0414<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 sqlite3. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/linuxhint.com\/install-sqlite-ubuntu-linux-mint\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>sqlite3 test_db.sqlite<\/code><\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/602\/5d8\/2de\/6025d82decdd4bcde1f086ec5cf42fda.png\" alt=\"sqlite3 command line shell\" title=\"sqlite3 command line shell\" width=\"836\" height=\"154\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/602\/5d8\/2de\/6025d82decdd4bcde1f086ec5cf42fda.png\"\/><figcaption>sqlite3 command line shell<\/figcaption><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>.database<\/code> \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u0439 \u0411\u0414:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/006\/1d2\/39c\/0061d239c973c4b1e3332b3de5369292.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0411\u0414\" title=\"\u0412\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0411\u0414\" width=\"838\" height=\"195\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/006\/1d2\/39c\/0061d239c973c4b1e3332b3de5369292.png\"\/><figcaption>\u0412\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0411\u0414<\/figcaption><\/figure>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>.fullschema<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (DDL) \u0441 \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/36b\/bff\/fcf\/36bbfffcf657564c1c25bcea980225b6.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b .fullschema\" title=\"\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b .fullschema\" width=\"853\" height=\"272\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/36b\/bff\/fcf\/36bbfffcf657564c1c25bcea980225b6.png\"\/><figcaption>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b .fullschema<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0438\u0434\u0435\u0442 \u043f\u043e \u043f\u043b\u0430\u043d\u0443.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/717\/415\/5f6\/7174155f6f6f8b1fa7c19510b96c6743.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445\" width=\"1266\" height=\"267\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/717\/415\/5f6\/7174155f6f6f8b1fa7c19510b96c6743.png\"\/><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"controller-and-service-creation\" id=\"controller-and-service-creation\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u043e\u0433\u043e RESTfull \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b. \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0432 NestJS <a href=\"https:\/\/docs.nestjs.com\/controllers\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b<\/a> \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 (URI), \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e web-\u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Postman, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0435\u0449\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0411\u0414, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439, \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442.\u0434. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0438\u043d\u043e\u0433\u0434\u0430 (\u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e!) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0442\u0438\u043f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0434\u0440. \u0421\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0438\u0445 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u2014 \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\/\u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0442.\u043d. <a href=\"https:\/\/ru.wikipedia.org\/wiki\/API\" rel=\"noopener noreferrer nofollow\">API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/a> \u0412\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>\u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0437 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438:<\/p>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 (\u043c\u043e\u0434\u0443\u043b\u044c, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443) \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D1%91%D1%80%D0%BD%D1%8B%D0%B9_%D1%8F%D1%89%D0%B8%D0%BA\" rel=\"noopener noreferrer nofollow\">\u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a<\/a>, \u0442\u043e API\u00a0\u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u00ab\u0440\u0443\u0447\u0435\u043a\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044f\u0449\u0438\u043a\u0430 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u0442\u0435\u0442\u044c \u0438 \u0434\u0451\u0440\u0433\u0430\u0442\u044c.  <\/p>\n<\/blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>nest g controller documents<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9a9\/2e5\/ed9\/9a92e5ed92f952687809c7f9d6dbbda3.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\" width=\"801\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a9\/2e5\/ed9\/9a92e5ed92f952687809c7f9d6dbbda3.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/figcaption><\/figure>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u0430\u0439\u043b\u044b <strong>documents.controller.ts<\/strong> (\u0441\u0430\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430) \u0438 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <strong>documents.controller.spec.ts<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f. CLI \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0430 \u0432\u0441\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c. \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/5b8b4cb6ff4a0805f6c0be7690918cd8c878f503#diff-5c3abcca324680ec4cb39b0ae614cb8b57a02d1f9d9e47afe71664de6613600e\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0438\u0442<\/a> \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\/\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432. \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 Nest \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 <a href=\"https:\/\/docs.nestjs.com\/providers\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440<\/a> (<a href=\"https:\/\/docs.nestjs.com\/providers#services\" rel=\"noopener noreferrer nofollow\">\u0441\u0435\u0440\u0432\u0438\u0441<\/a>).<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c, \u043a\u0430\u043a \u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f <code>nest g service documents<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/c31bdbdde28c239dfd53cf5d3772954c4c8ac2e4\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442.<\/p>\n<p><a class=\"anchor\" name=\"dto\" id=\"dto\"><\/a><\/p>\n<h2>Data Transfer Object (DTO)<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u2014 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>src\/documents<\/strong> \u043f\u0430\u043f\u043a\u0443 <strong>dto<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/835b101d2f930e24ac92d60a0622ea35a8a0fdc8\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430<\/a>:<\/p>\n<p>\u0424\u0430\u0439\u043b <strong>create-document.dto.ts<\/strong> \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"typescript\">export class CreateDocumentDto {   id: Number;   cipher: String;   createdOn: Date;   inArchive: Boolean; }<\/code><\/pre>\n<p>\u0438 <strong>paging-document.dto.ts<\/strong> \u0441 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"typescript\">import { CreateDocumentDto } from '.\/create-document.dto';  export class PagingDocumentDto extends CreateDocumentDto {   paging: {};   sorting: {};   filtering: {}; }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e DTO \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/docs.nestjs.com\/controllers#request-payloads\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, DTO \u2014 \u044d\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b (\u043a\u043b\u0430\u0441\u0441\u044b), \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 entities, \u0442.\u0435. \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u0435\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0432 \u0411\u0414 \u0438 \u0442\u0435\u043b\u043e\u043c HTTP &#8212; \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u0432 \u043e\u0444. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 DTO \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Request payloads). \u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c DTO-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u044b, \u0447\u0442\u043e \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445.<\/p>\n<p>\u0412<strong> create-document.dto.ts<\/strong> \u0443 \u043d\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u2014 \u043a\u0430\u043a \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0432 \u043d\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u0430\u043a \u0438 \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 &#171;\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442&#187;. \u041a\u043b\u0430\u0441\u0441 PagingDocumentDto \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>paging-document.dto.ts<\/strong> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 CreateDocumentDto \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0449\u0435 \u0442\u0440\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u0417\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b  \u2014 \u0443\u0437\u043d\u0430\u0435\u043c \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u043e\u0440\u043e. <\/p>\n<p><a class=\"anchor\" name=\"api-implementation\" id=\"api-implementation\"><\/a><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f API. Dependency injection<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c DocumentService):<\/p>\n<pre><code class=\"typescript\">constructor(private readonly documentService: DocumentService) {}<\/code><\/pre>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b&#8230;\u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041d\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u043c\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u043b\u0438 \u0432 \u043d\u0430\u0448 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0441\u0435\u0440\u0432\u0438\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D0%BD%D0%B5%D0%B4%D1%80%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B7%D0%B0%D0%B2%D0%B8%D1%81%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8\" rel=\"noopener noreferrer nofollow\">Dependency injection<\/a>. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a NestJS (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d) \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u044d\u0442\u043e\u043c <a href=\"https:\/\/docs.nestjs.com\/providers#dependency-injection\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435<\/a>. \u0410 \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b DocumentService, \u2014 \u043e\u043d (\u0441\u0435\u0440\u0432\u0438\u0441), \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043d\u0430\u0431\u0436\u0435\u043d \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u043c <a class=\"mention\" href=\"\/users\/injectable()\">@Injectable()<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c. \u042d\u0442\u043e \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Inversion_of_control\" rel=\"noopener noreferrer nofollow\">IoS<\/a>, \u043e\u0431 \u044d\u0442\u043e\u043c \u0442\u043e\u0436\u0435 <a href=\"https:\/\/docs.nestjs.com\/providers#services\" rel=\"noopener noreferrer nofollow\">\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f <\/a>\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e Nest.<\/p>\n<p>\u041d\u0443 \u0432\u0441\u0435, \u0445\u0432\u0430\u0442\u0438\u0442 \u0443\u043c\u043d\u044b\u0445 \u0441\u043b\u043e\u0432&#8230;.\u043f\u043e\u0435\u0445\u0430\u043b\u0438 \u0434\u0430\u043b\u044c\u0448\u0435!<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0440\u043e\u0443\u0442\u0430), \u2014 GET, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c &#171;\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f&#187; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0411\u0414:<\/p>\n<pre><code class=\"typescript\">@Get() findAll() {   return this.documentService.findAllDocuments(); }<\/code><\/pre>\n<p>\u0438 POST \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"typescript\"> @Post()   create(@Body() createDocumentDto: CreateDocumentDto) {     return this.documentService       .createDocument(createDocumentDto)       .then((response) => {         return response;       })       .catch((error) => {         throw new HttpException('\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 =(: ' + error, HttpStatus.INTERNAL_SERVER_ERROR);       })  }<\/code><\/pre>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0444\u0430\u0439\u043b <strong>documents.controller.ts<\/strong> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<details class=\"spoiler\">\n<summary>documents.controller.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"typescript\">import { DocumentsService } from '.\/documents.service'; import { CreateDocumentDto } from '.\/dto\/create-document.dto'; import {    Body,    Controller,    Get,    HttpException,    HttpStatus,    Post  } from '@nestjs\/common';  @Controller('documents') export class DocumentsController {    constructor(private readonly documentService: DocumentsService) { }    @Get()   findAll() {     return this.documentService.findAllDocuments();   }    @Post()   create(@Body() createDocumentDto: CreateDocumentDto) {     return this.documentService       .createDocument(createDocumentDto)       .then((response) => {         return response;       })       .catch((error) => {         throw new HttpException('\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 =(: ' + error, HttpStatus.INTERNAL_SERVER_ERROR);       })   } } <\/code><\/pre>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440<a class=\"mention\" href=\"\/users\/body\">@Body<\/a>\u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 createDocumentDto \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043b\u043e POST-\u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \u043a\u043b\u044e\u0447\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 CreateDocumentDto<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b findAllDocuments() \u0438 createDocument() \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"typescript\">async findAllDocuments(): Promise&lt;Document[]> {     return await this.dataSource.getRepository(Document).find(); }<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"typescript\">async createDocument(createDocumentDto: CreateDocumentDto): Promise&lt;InsertResult> {     return await this.dataSource       .createQueryBuilder()       .insert()       .into(Document)       .values([         {           cipher: createDocumentDto.cipher,           createdOn: createDocumentDto.createdOn,           inArchive: createDocumentDto.inArchive,         },       ])       .execute();   }<\/code><\/pre>\n<p>\u0412 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Learn\/JavaScript\/Asynchronous\/Introducing\" rel=\"noopener noreferrer nofollow\">async\/await<\/a> \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 TypeORM \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 <a href=\"https:\/\/github.com\/typeorm\/typeorm\/blob\/master\/CHANGELOG.md#features-6\" rel=\"noopener noreferrer nofollow\">DataSource<\/a> \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0411\u0414.<\/p>\n<p>\u041d\u0443 \u0447\u0442\u043e, \u043f\u0440\u043e\u0431\u0443\u0435\u043c &#171;\u0434\u0435\u0440\u0433\u0430\u0442\u044c&#187; \u043d\u0430\u0448\u0435 API&#8230;!<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c <strong>127.0.0.1:3000\/documents<\/strong>. \u0412\u043e\u0442, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/459\/b11\/539\/459b115395aa0bf2c609e78771686cbd.png\" alt=\"\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432\" title=\"\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432\" width=\"771\" height=\"291\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/459\/b11\/539\/459b115395aa0bf2c609e78771686cbd.png\"\/><figcaption>\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/figcaption><\/figure>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Mozilla \u0443\u043c\u0435\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c JSON \u043e\u0442\u0432\u0435\u0442\u044b. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0412\u0421\u0415 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d.<\/p>\n<p><a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/e8fa8f5ad6747b1a09b0da649609a6f75cb2f036\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p><a class=\"anchor\" name=\"postman\" id=\"postman\"><\/a><\/p>\n<h2>Postman. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c API \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0411\u0414<\/h2>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043d\u043e \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432\u044b\u0448\u0435, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u0442\u0435\u043b\u043e, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.<\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Postman. \u041e \u0442\u043e\u043c \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u2014 \u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/www.postman.com\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0410 \u043e \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/habr.com\/ru\/company\/maxilect\/blog\/596789\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/company\/kolesa\/blog\/351250\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0432 \u0411\u0414. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f19\/2bf\/d99\/f192bfd994f7e8062d6bc2a9f19bf383.png\" alt=\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414\" title=\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414\" width=\"647\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f19\/2bf\/d99\/f192bfd994f7e8062d6bc2a9f19bf383.png\"\/><figcaption>POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>cURL \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/summary>\n<div class=\"spoiler__content\">\n<p>curl &#8212;location &#8212;request POST &#8216;127.0.0.1:3000\/documents&#8217; <br \/> &#8212;header &#8216;Content-Type: application\/json&#8217; <br \/> &#8212;data-raw &#8216;{<br \/> &#171;cipher&#187;: &#171;7e0535f9-666e-45c4-843d-6c366a4a9d80&#187;,<br \/> &#171;createdOn&#187;: &#171;2019-03-18T15:49:00.000Z&#187;,<br \/> &#171;inArchive&#187;: false<br \/> }&#8217;<\/p>\n<p>\u0418\u043c\u0435\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 cURL \u2014 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0435\u0433\u043e \u0432 Postman. \u0412 \u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c &#171;Import&#187;:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ae\/018\/27f\/6ae01827f6c3efec7582f5bdc6a3c31c.png\" alt=\"\u0418\u043c\u043f\u043e\u0440\u0442\" title=\"\u0418\u043c\u043f\u043e\u0440\u0442\" width=\"379\" height=\"90\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ae\/018\/27f\/6ae01827f6c3efec7582f5bdc6a3c31c.png\"\/><figcaption>\u0418\u043c\u043f\u043e\u0440\u0442<\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;Raw text&#187;, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c cURL \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c &#171;Continue&#187;:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/539\/5cf\/7dd\/5395cf7dd52650d9989386b8ea2249b1.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c cURL\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c cURL\" width=\"847\" height=\"570\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/539\/5cf\/7dd\/5395cf7dd52650d9989386b8ea2249b1.png\"\/><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c cURL<\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c &#171;Import&#187;:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e46\/aa9\/5c1\/e46aa95c15c6a266f60fba6fb4534051.png\" alt=\"\u0418 \u0435\u0449\u0435 \u0440\u0430\u0437 Import\" title=\"\u0418 \u0435\u0449\u0435 \u0440\u0430\u0437 Import\" width=\"849\" height=\"572\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e46\/aa9\/5c1\/e46aa95c15c6a266f60fba6fb4534051.png\"\/><figcaption>\u0418 \u0435\u0449\u0435 \u0440\u0430\u0437 Import<\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u0411\u044c\u044e\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 JSON:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff5\/b36\/236\/ff5b36236ab6cbfb356a59b8dd3a2eb0.png\" alt=\"\u0414\u0435\u043b\u0430\u0435\u043c JSON \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439\" title=\"\u0414\u0435\u043b\u0430\u0435\u043c JSON \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439\" width=\"855\" height=\"208\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff5\/b36\/236\/ff5b36236ab6cbfb356a59b8dd3a2eb0.png\"\/><figcaption>\u0414\u0435\u043b\u0430\u0435\u043c JSON \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439<\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u043e\u0442\u043e\u0432. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;Send&#187;.<\/p>\n<\/li>\n<li>\n<p>\u0410 \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c cURL \u0438\u0437 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u2014 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u0432 \u043f\u0440\u0430\u0432\u043e\u043c-\u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c &#171;&lt;\/>&#187;, \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u043b\u043a\u0435 cURL \u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/47a\/1d2\/f72\/47a1d2f7238af39890ade28ea438ccd9.png\" alt=\"\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u043a cURL\" title=\"\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u043a cURL\" width=\"436\" height=\"266\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/47a\/1d2\/f72\/47a1d2f7238af39890ade28ea438ccd9.png\"\/><figcaption>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u043a cURL<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u2014 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0439\u0442\u0438 id \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 201-\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ed0\/2b3\/50b\/ed02b350b4f88d5b4b5d5bb0fdfb8750.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\" width=\"1494\" height=\"337\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ed0\/2b3\/50b\/ed02b350b4f88d5b4b5d5bb0fdfb8750.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/figcaption><\/figure>\n<p>\u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0442\u043d\u044e\/\u0442\u044b\u0441\u044f\u0447\u0443 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u041f\u0440\u0438\u0447\u0435\u043c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u043b\u0438\u0431\u043e \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 REST, \u043d\u043e, \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0438\u0437\u0443\u0447\u0430\u0442\u044c Postman, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u041c\u0430\u0441\u0441\u043e\u0432\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 Postman<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043d\u0430\u0448 POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0430\u043f\u043a\u0435:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1e3\/84e\/55e\/1e384e55e880196f134bbc328ce645e0.png\" alt=\"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435\" title=\"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435\" width=\"284\" height=\"65\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e3\/84e\/55e\/1e384e55e880196f134bbc328ce645e0.png\"\/><figcaption>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435<\/figcaption><\/figure>\n<p>\u0437\u0430\u0442\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ce\/610\/bf0\/5ce610bf0ebb9407df2b274d54db27aa.png\" alt=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\" title=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\" width=\"548\" height=\"299\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ce\/610\/bf0\/5ce610bf0ebb9407df2b274d54db27aa.png\"\/><figcaption>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u0432 \u0434\u0432\u043e\u0439\u043d\u044b\u0445 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442.\u043d. \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;Pre-request Script&#187; \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 JS \u043a\u043e\u0434:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff7\/344\/c19\/ff7344c19db1fe295c7e2da6a92427f7.png\" alt=\"\u041a\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438\" title=\"\u041a\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438\" width=\"724\" height=\"294\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff7\/344\/c19\/ff7344c19db1fe295c7e2da6a92427f7.png\"\/><figcaption>\u041a\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/figcaption><\/figure>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c JavaScript \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u041f\u0415\u0420\u0415\u0414 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u0432\u044b\u0448\u0435 \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e randomDate(start, end), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 (\u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0434\u0443\u043c\u0430\u0442\u044c \u043b\u0435\u043d\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0437\u044f\u043b \u043a\u043e\u0434 <a href=\"https:\/\/stackoverflow.com\/questions\/9035627\/elegant-method-to-generate-array-of-random-dates-within-two-dates\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>).<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Postman:<\/p>\n<pre><code class=\"javascript\">pm.environment.set(\"variable_key\", \"variable_value\");<\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>createdOn<\/strong>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e randomDate \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430:<\/p>\n<pre><code class=\"javascript\">pm.environment.set(\"createdOn\", randomDate(new Date(2012, 0, 1), new Date()));<\/code><\/pre>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e\u0435 \u0431\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>inArchive<\/strong> (\u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442!) \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">pm.environment.set(\"inArchive\", Math.random() &lt; 0.5);<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 GUID \u0434\u043b\u044f \u043f\u043e\u043b\u044f <strong>cipher<\/strong> \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">pm.environment.set(\"cipher\", \"{{$guid}}\");<\/code><\/pre>\n<p>\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/682\/917\/dcb\/682917dcb077f4f5533620833d33ec77.png\" alt=\"\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\" title=\"\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\" width=\"236\" height=\"78\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/682\/917\/dcb\/682917dcb077f4f5533620833d33ec77.png\"\/><figcaption>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043f\u043e \u043f\u0430\u043f\u043a\u0435 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 &#171;Run collection&#187;:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a50\/cbe\/d7f\/a50cbed7f8403baa4027bf15f654e2c7.png\" width=\"290\" height=\"544\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a50\/cbe\/d7f\/a50cbed7f8403baa4027bf15f654e2c7.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 POST-\u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443. \u0422.\u043a. \u0443 \u043d\u0430\u0441 \u0432 \u0411\u0414 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c 2 \u0437\u0430\u043f\u0438\u0441\u0438, \u0437\u0430\u0434\u0430\u0434\u0438\u043c 98 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 &#171;Save responces&#187; \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b (\u043c\u0430\u043b\u043e \u043b\u0438, \u0432\u0434\u0440\u0443\u0433 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a):<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/38f\/46a\/bc6\/38f46abc6787ab3f0a32f2bb74ac212e.png\" alt=\"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438\" title=\"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438\" width=\"1265\" height=\"471\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/38f\/46a\/bc6\/38f46abc6787ab3f0a32f2bb74ac212e.png\"\/><figcaption>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c &#171;Run grid-component-backend&#187;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u2014 Postman \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 98 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0435\u0439:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ae2\/5e9\/cee\/ae25e9ceec9aa9fe8708f6b539bdc5f0.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 98 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 98 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" width=\"1539\" height=\"730\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ae2\/5e9\/cee\/ae25e9ceec9aa9fe8708f6b539bdc5f0.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 98 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0411\u0414 \u043c\u043e\u0436\u043d\u043e \u0442\u0440\u0435\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c SQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0411\u0414, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043f\u043e\u0441\u0442\u043c\u044d\u043d\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430\u043c JSON-\u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 cURL \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 cURL \u0438\u0437 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 Network \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 Postman.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 (\u0443 \u043c\u0435\u043d\u044f Mozilla, \u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u043a\u0430\u0442\u0438\u0442 \u0438 \u0434\u043b\u044f Google Chrome) \u043d\u0430\u0436\u043c\u0435\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0443 F12 \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0412\u0432\u0435\u0434\u0435\u043c \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 <strong>http:\/\/127.0.0.1:3000\/documents<\/strong> \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f GET-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043d\u0430\u0436\u043c\u0435\u043c Enter. \u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Network \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d44\/ed3\/bfe\/d44ed3bfebcce14e86cb3e90f92895d8.png\" width=\"1910\" height=\"900\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d44\/ed3\/bfe\/d44ed3bfebcce14e86cb3e90f92895d8.png\"\/><figcaption><\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u2014 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u043c \u043c\u0435\u043d\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u0446\u0438\u044e <strong>Copy as cURL<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u043c cURL \u0438 \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 Postman:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f5d\/4e4\/b1b\/f5d4e4b1b53931a6468837281fe3316f.png\" width=\"795\" height=\"267\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5d\/4e4\/b1b\/f5d4e4b1b53931a6468837281fe3316f.png\"\/><figcaption><\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 API \u0432 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"paging-sorting-filtering\" id=\"paging-sorting-filtering\"><\/a><\/p>\n<h2>\u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432 \u0411\u0414 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e (\u0446\u0435\u043b\u044b\u0445 100, \u0430 \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435!) \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438. \u0412\u043e\u043e\u0431\u0449\u0435, \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f, \u043e\u0447\u0435\u043d\u044c \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439. \u041f\u043e\u0433\u0443\u0433\u043b\u0438\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u0432\u0430 \u0441\u0442\u0438\u043b\u044f (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430) \u2014 <em>skip-take<\/em> \u0438 <em>limit-offset<\/em>. \u041d\u043e! \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u0432\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0421\u0423\u0411\u0414 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0438 \u0448\u0442\u0430\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/post\/301044\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e \u0432 Postgres, \u0430 \u0432\u043e\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/www.postgresql.org\/docs\/current\/queries-limit.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0430<\/a> \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043c\u0435\u044e\u0449\u0443\u044e\u0441\u044f ORM, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 TypeORM. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u043c \u044d\u0442\u043e \u0443 \u0433\u0443\u0433\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 <a href=\"https:\/\/stackoverflow.com\/questions\/53922503\/how-to-implement-pagination-in-nestjs-with-typeorm\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u043e\u0442\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0442\u044d\u043a\u043e\u0432\u0435\u0440\u0444\u043b\u043e\u0443. \u041d\u0443 \u0432\u0441\u0435&#8230;\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e POST \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 NestJS \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 201 \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438\/\u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u2014 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <a class=\"mention\" href=\"\/users\/HttpCode\">@HttpCode<\/a>\u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0430):<\/p>\n<pre><code class=\"typescript\">@Post('\/findPaginated') @HttpCode(HttpStatus.OK)   findPaginated(@Body() pagingDocumentDto: PagingDocumentDto) {     return this.documentService.findPaginated(pagingDocumentDto); }<\/code><\/pre>\n<p>\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e,  \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"typescript\">async findPaginated(pagingDocumentDto: PagingDocumentDto) {      let options = {       skip: pagingDocumentDto.paging['skip'],       take: pagingDocumentDto.paging['take'],       order: pagingDocumentDto.sorting,     };      const filter = pagingDocumentDto.filtering;      let filters = {};      \/\/ \u0426\u0438\u043a\u043b \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432     for (var column in filter) {       if (Object.prototype.hasOwnProperty.call(filter, column)) {         const valueToFilter = filter[column]['valueToFilter'];         const comparisonOperator = filter[column]['comparisonOperator'];         const columnType = filter[column]['columnType'];         if (valueToFilter || valueToFilter === false) {           filters[column] = this.operatorMapping(             columnType,             comparisonOperator,             valueToFilter,           );         }       }     }      options['where'] = filters;      const [documents, count] = await this.dataSource.getRepository(Document).findAndCount(       options,     );      return {       documents,       count,     };    }    operatorMapping(     columnType: string,     comparisonOperator: string,     valueToFilter: any,   ): FindOperator&lt;any> {     switch (comparisonOperator) {       case 'likeOperator':         if (['number', 'datetime-local'].includes(columnType))           return Raw(             (alias) =>               `lower(cast(${alias} as text)) like '%${(                 valueToFilter + ''               ).toLowerCase()}%'`,           );         \/\/ if (['string'].includes(columnType))                 return Raw(           (alias) =>             `lower(${alias}) like '%${(valueToFilter + '').toLowerCase()}%'`,         );       case 'notLikeOperator':         if (['number', 'datetime-local'].includes(columnType))           return Raw(             (alias) =>               `lower(cast(${alias} as text)) not like '%${(                 valueToFilter + ''               ).toLowerCase()}%'`,           );         \/\/ if (['string'].includes(columnType))         return Raw(           (alias) =>             `lower(${alias}) not like '%${(               valueToFilter + ''             ).toLowerCase()}%'`,         );       case 'greaterThanOperator':         return MoreThan(valueToFilter);       case 'greaterThanOrEqualOperator':         return MoreThanOrEqual(valueToFilter);       case 'lessThanOperator':         return LessThan(valueToFilter);       case 'lessThanOrEqualOperator':         return LessThanOrEqual(valueToFilter);       case 'notEqualOperator':         return Not(valueToFilter);       default:         \/\/ equalOperator         return Equal(valueToFilter);     }   }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>\u0421 \u0444\u0440\u043e\u043d\u0442\u0430 \u043a \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0435\u043b\u0430:<\/p>\n<pre><code class=\"json\">{     \"paging\": {         \"skip\": 0,         \"take\": \"5\"     },     \"sorting\": {         \"createdOn\": \"DESC\"     },     \"filtering\": {         \"createdOn\": {             \"columnType\": \"datetime-local\",             \"comparisonOperator\": \"greaterThanOrEqualOperator\",             \"valueToFilter\": \"2016-02-11T14:44\"         },         \"cipher\": {             \"columnType\": \"text\",             \"comparisonOperator\": \"likeOperator\",             \"valueToFilter\": \"14\"         }     } }<\/code><\/pre>\n<p>\u0412 \u043e\u0431\u044a\u0435\u043a\u0442 options \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438 (skip, take) \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 (order):<\/p>\n<pre><code class=\"typescript\">let options = {       skip: pagingDocumentDto.paging['skip'],       take: pagingDocumentDto.paging['take'],       order: pagingDocumentDto.sorting,     };<\/code><\/pre>\n<p> \u0432 filter \u0441\u044d\u0439\u0432\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"typescript\">const filter = pagingDocumentDto.filtering;<\/code><\/pre>\n<p>\u0412 \u043e\u0431\u044a\u0435\u043a\u0442 filters \u0431\u0443\u0434\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"typescript\">let filters = {};      \/\/ \u0426\u0438\u043a\u043b \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432     for (var column in filter) {       if (Object.prototype.hasOwnProperty.call(filter, column)) {         const valueToFilter = filter[column]['valueToFilter'];         const comparisonOperator = filter[column]['comparisonOperator'];         const columnType = filter[column]['columnType'];         if (valueToFilter || valueToFilter === false) {           filters[column] = this.operatorMapping(             columnType,             comparisonOperator,             valueToFilter,           );         }       }     }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 filtering \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u044b\u0448\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u0445 \u0432 \u043c\u0435\u0442\u043e\u0434 operatorMapping(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u043c <a href=\"https:\/\/github.com\/typeorm\/typeorm\/blob\/master\/docs\/find-options.md\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430<\/a>.<\/p>\n<p>\u0414\u043b\u044f like-\u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 Raw. \u041f\u0440\u0438\u0447\u0435\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c \u0441 \u043d\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043a\u0430\u0441\u0442\u0430\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u043d\u0443 \u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443:<\/p>\n<pre><code class=\"typescript\">return Raw(             (alias) =>               `lower(cast(${alias} as text)) like '%${(                 valueToFilter + ''               ).toLowerCase()}%'`,           );<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043c\u0435\u0442\u043e\u0434 findAndCount, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"typescript\">const [documents, count] = await this.dataSource.getRepository(Document).findAndCount(       options,     );<\/code><\/pre>\n<p><a class=\"anchor\" name=\"cors\" id=\"cors\"><\/a><\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0440\u043e\u043d\u0442 \u0438 \u0431\u044d\u043a. \u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. CORS<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u2014 <s>\u0432\u043e\u0434\u0430, \u043a\u0438\u043f\u044f\u0449\u0435\u0435 \u043c\u0430\u0441\u043b\u043e<\/s> \u0431\u044d\u043a \u0438 \u0444\u0440\u043e\u043d\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0412\u044b \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u2014  \u043b\u0438\u043d\u0443\u043a\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435. \u042d\u0442\u043e, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u043e\u043b\u044c! \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u2014 \u044f \u0437\u0430\u043a\u0440\u043e\u044e VS Code \u0438 \u0437\u0430\u043f\u0443\u0449\u0443 \u0444\u0440\u043e\u043d\u0442 \u0438 \u0431\u044d\u043a \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435. <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bf7\/0ae\/e8f\/bf70aee8f2552837b9311c7cffed5c74.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a backend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a backend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" width=\"1090\" height=\"408\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bf7\/0ae\/e8f\/bf70aee8f2552837b9311c7cffed5c74.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a backend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0444\u0440\u043e\u043d\u0442 (\u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435):<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0f8\/e1a\/e5d\/0f8e1ae5d7b6b5a2efa4ce48cb76fd84.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a frontend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a frontend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" width=\"1087\" height=\"435\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0f8\/e1a\/e5d\/0f8e1ae5d7b6b5a2efa4ce48cb76fd84.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a frontend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0440\u043e\u043d\u0442 \u0432\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/676622\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0433\u0440\u0438\u0434 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0415\u0441\u043b\u0438 \u0443\u0441\u043f\u0435\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u044c F12 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7c\/205\/429\/f7c2054290012a9fde4c4947fe659d53.png\" width=\"1916\" height=\"620\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7c\/205\/429\/f7c2054290012a9fde4c4947fe659d53.png\"\/><figcaption><\/figcaption><\/figure>\n<p><em>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <\/em><a href=\"http:\/\/127.0.0.1:3000\/documents\/findPaginated\" rel=\"noopener noreferrer nofollow\"><em>http:\/\/127.0.0.1:3000\/documents\/findPaginated<\/em><\/a><em>. (Reason: CORS header \u2018Access-Control-Allow-Origin\u2019 missing). Status code: 404.<\/em> <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c. \u0424\u0440\u043e\u043d\u0442 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <strong>127.0.0.1:8080<\/strong>, \u0430 \u0431\u044d\u043a \u043d\u0430 <strong>127.0.0.1:3000<\/strong>. \u0422.\u0435. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 <strong>\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/strong> (<a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/HTTP\/Headers\/Origin\" rel=\"noopener noreferrer nofollow\">Origins<\/a>), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 (cross) \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6be\/b7a\/94c\/6beb7a94c520fc03681011deedd24de0.png\" alt=\"Cross-Origin Resource Sharing (CORS)\" title=\"Cross-Origin Resource Sharing (CORS)\" width=\"765\" height=\"254\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6be\/b7a\/94c\/6beb7a94c520fc03681011deedd24de0.png\"\/><figcaption>Cross-Origin Resource Sharing (CORS)<\/figcaption><\/figure>\n<p>\u043d\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u2014 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Security\/Same-origin_policy\" rel=\"noopener noreferrer nofollow\">Same-origin policy<\/a> (\u0430 \u0443 \u043d\u0430\u0441 \u043e\u043d\u0438 \u0440\u0430\u0437\u043d\u044b\u0435, \u0442.\u043a. \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b), \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0440\u044b, \u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.<\/p>\n<p>\u0412 NestJS \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/docs.nestjs.com\/security\/cors\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/a> \u043f\u043e CORS, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u0440\u0443\u0433\u0430\u043b\u0441\u044f. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u2014 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c (\u0432 \u0444\u0430\u0439\u043b main.ts <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/5015893a24c8653ca2515731fc48bf9b604ae576\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/a> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u043f\u0446\u0438\u044e):<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bfb\/a30\/38f\/bfba3038f7e0ed38b250e7c662462bf7.png\" alt=\"\u0414\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f cross origin requests\" title=\"\u0414\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f cross origin requests\" width=\"591\" height=\"112\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bfb\/a30\/38f\/bfba3038f7e0ed38b250e7c662462bf7.png\"\/><figcaption>\u0414\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f cross origin requests<\/figcaption><\/figure>\n<p>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm run start:dev<\/code> \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/206\/043\/33a\/20604333a2b83daf0bc676182e775178.png\" alt=\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b\" title=\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b\" width=\"1238\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/206\/043\/33a\/20604333a2b83daf0bc676182e775178.png\"\/><figcaption>\u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b<\/figcaption><\/figure>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b, \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>P.S> \u041c\u043e\u0437\u0438\u043b\u043b\u0430 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0432\u0430 (\u0430 \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043f\u0440\u0430\u0432\u0430) \u0438 \u0433\u0430\u043b\u043e\u0447\u043a\u0438 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u044b \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443, \u0445\u043e\u0442\u044f \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0432\u0430. \u0425\u0440\u043e\u043c \u0436\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u043a\u0430\u043a \u0438 \u044f \u0445\u043e\u0442\u0435\u043b (\u043a\u0430\u043a \u0432 <a href=\"https:\/\/codesandbox.io\/s\/grid-component-frontend-ib6rqm\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435<\/a>). \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043c\u044b\u0441\u043b\u0438 \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p><a class=\"anchor\" name=\"conclusion\" id=\"conclusion\"><\/a><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041d\u0443 \u0432\u043e\u0442, \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e&#8230;\u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b! \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u0412\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438, \u2014 \u0432\u0441\u0435 \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u2014 \u044d\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0430\u0434\u0432\u043e\u0434\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0430 \u043b\u0438\u0448\u044c \u0441\u043d\u0435\u0436\u043d\u0430\u044f \u0448\u0430\u043f\u043a\u0430, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0430\u0439\u0441\u0431\u0435\u0440\u0433\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Web-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0433\u0434\u0435-\u0442\u043e \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/59f\/915\/211\/59f9152113eac803e4e1208cadf8203b.png\" alt=\"\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0430\u0439\u0441\u0431\u0435\u0440\u0433\" title=\"\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0430\u0439\u0441\u0431\u0435\u0440\u0433\" width=\"380\" height=\"444\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59f\/915\/211\/59f9152113eac803e4e1208cadf8203b.png\"\/><figcaption>\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0430\u0439\u0441\u0431\u0435\u0440\u0433<\/figcaption><\/figure>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0431\u044b\u043b \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0438 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f Web-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/678682\/\"> https:\/\/habr.com\/ru\/post\/678682\/<\/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>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0434\u043d\u044f, \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435!<\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0431\u0435\u0449\u0430\u043b, \u0432 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/post\/676622\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0433\u0440\u0438\u0434-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u043f\u0438\u0448\u0443 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 backend \u0447\u0430\u0441\u0442\u0438 \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043a\u0430\u043a NestJS, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f backend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u043a\u0440\u0443\u0442\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443, \u0441\u043a\u043e\u0440\u0435\u0435 \u2013 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0435\u0433\u043e \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u043c. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 NestJS, \u0430 \u043d\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastApi <\/a>(Python), <a href=\"https:\/\/spring.io\/projects\/spring-boot\" rel=\"noopener noreferrer nofollow\">Spring Boot<\/a> (Java) \u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u043e\u0434\u043d\u044b\u0439 backend \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c? \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043a\u043e\u0442\u0438\u043a\u0438! <\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u0431\u0437\u043e\u0440 \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u043e\u0442 NestJS<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption>\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>Controllers<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u044b \u043f\u043e NestJS<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>\u0423\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043d\u044e \u0433\u0434\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>\u041a\u043e\u0442\u0438\u043a \u043d\u0430 \u0441\u0442\u0443\u043b\u0435<\/figcaption><\/figure>\n<p>P.S. \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0449\u0435 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0442\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435. <br \/>\u041d\u0430\u0439\u0434\u0435\u0442\u0435 &#8212; \u043a\u0438\u0434\u0430\u0439\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u0428\u0443\u0447\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0442\u044f \u043a\u043e\u0442\u044b \u0432 <a href=\"https:\/\/nestjs.com\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0447\u0443\u0436\u043e\u043c <s>\u0433\u043e\u0432\u043d\u043e<\/s> \u043a\u043e\u0434\u0435, \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0442.\u043f. \u041d\u0443 \u0438 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u2014 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0431\u0440\u0435\u043b \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u0438\u043c\u0435\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e (\u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043b\u0435\u043d\u044c <a href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/663234\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438<\/a> \u0435\u0435 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439) \u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 RESTfull \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u043e\u0431\u0437\u043e\u0440\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/company\/domclick\/blog\/567816\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u043b\u0443!<\/p>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434 Linux (Ubuntu). \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c NodeJS, npm (\u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/676622\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>) \u043d\u0443 \u0438 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u2014 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0442\u0432\u043e\u0440\u0438\u0442\u044c!<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#install-nestcli\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NestJS \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#hot-reload-setup\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Hot Reload<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#sqlite-setup\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#document-module-creation\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#controller-and-service-creation\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#dto\" rel=\"noopener noreferrer nofollow\">Data Transfer Object (DTO)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#api-implementation\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f API. Dependency injection<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#postman\" rel=\"noopener noreferrer nofollow\">Postman. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c API \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0411\u0414<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#paging-sorting-filtering\" rel=\"noopener noreferrer nofollow\">\u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#cors\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0440\u043e\u043d\u0442 \u0438 \u0431\u044d\u043a. \u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. CORS<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/678682\/#conclusion\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"install-nestcli\" id=\"install-nestcli\"><\/a><\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NestJS \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u2014 \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0434\u043b\u044f VueJS, \u0434\u043b\u044f NestJS \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u044f CLI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 <a href=\"https:\/\/docs.nestjs.com\/#installation\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI <\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>npm i -g @nestjs\/cli<\/code><\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nest CLI \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438<\/figcaption><\/figure>\n<p>\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 9.0.0. \u0412\u044b\u0432\u043e\u0434 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0443 \u0412\u0430\u0441 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0442.\u043a. \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d nest \u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b.<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>nest new grid-component-backend<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0440\u0435\u0434\u0430 nest cli \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440. \u042f \u0432\u044b\u0431\u0435\u0440\u0443 npm (\u0438 \u0412\u0430\u043c \u0442\u043e\u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e) \u0438 \u0436\u043c\u0435\u043c Enter:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0412\u044b\u0431\u043e\u0440 npm \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/figcaption><\/figure>\n<p>\u0436\u0434\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 \u0434\u043e\u043d\u0430\u0442 =)<\/figcaption><\/figure>\n<p>P.S. \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u043e\u043d\u0430\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u043e \u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u0440\u043e\u043f\u0443\u0449\u0443 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 =)<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u2014  \u0432\u0441\u0435 \u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<code>cd grid-component-backend<\/code> \u0438 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 <code>npm run start<\/code>:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<p>\u0417\u0435\u043b\u0435\u043d\u0435\u043d\u044c\u043a\u0438\u0435 \u043b\u043e\u0433\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 http:\/\/127.0.0.1:3000 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"bordered full-width\"><figcaption>Hello World \u043d\u0430 NestJS<\/figcaption><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 (Ctrl+C) \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 VS Code.<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0443\u044e <a href=\"https:\/\/www.sqlite.org\/index.html\" rel=\"noopener noreferrer nofollow\">sqlite<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"hot-reload-setup\" id=\"hot-reload-setup\"><\/a><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Hot Reload<\/h2>\n<p>Nest \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/docs.nestjs.com\/recipes\/hot-reload\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/a> \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\/\u0431\u0438\u043b\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0412\u044b \u043a\u0430\u043a \u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Nest CLI, \u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/b8795d66fc788bbbbed05856795c5d4d0b6f52d9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u043a\u0435\u0442\u044b<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm i --save-dev webpack-node-externals run-script-webpack-plugin webpack<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>webpack-hmr.config.js<\/strong> \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-daae7b65b9b41cd81aae4709dc7ea01dc706a918806efb5e9c64f460a5ba7afa\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b <strong>src\/main.ts<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3d\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p> \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>package.json<\/strong> <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/0280ca996f03fe5ec9ae9abe93d3c744a5052609#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/a> \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run start:dev<\/code> .<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c&#8230;\u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u044e\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Hot Reload<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered full-width\"><figcaption>\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/figure>\n<p>\u0432\u0438\u0434\u0438\u043c\u043e \u043d\u0435 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u043b\u0430\u0434\u043a\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 webpack \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0438\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>webpack-hmr.config.js<\/strong>:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e autoRestart<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0438 \u0437\u043d\u0430\u0435\u0442 \u0441 \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u043b\u0435\u0447\u0438\u0442\u044c \u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p><a class=\"anchor\" name=\"sqlite-setup\" id=\"sqlite-setup\"><\/a><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sqlite. \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.nestjs.com\/techniques\/database\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u2014 Nest \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 @nestjs\/typeorm \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f TypeORM \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414 sqlite c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm install --save @nestjs\/typeorm typeorm sqlite3<\/code> . \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>package.json<\/strong> \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u0438 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/8e44992422aeea287016ae7949b7d67c71c4c4cb#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0411\u0414. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 sqlite \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e:<\/p>\n<details class=\"spoiler\">\n<summary>app.module.ts<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"typescript\">import { Module } from '@nestjs\/common'; import { AppController } from '.\/app.controller'; import { AppService } from '.\/app.service'; import { TypeOrmModule } from '@nestjs\/typeorm'; import { DocumentsModule } from '.\/documents\/documents.module';  @Module({   imports: [     TypeOrmModule.forRoot({       type: 'sqlite',       database: '.\/test_db.sqlite',       synchronize: true,       autoLoadEntities: true,     }),      DocumentsModule  \/\/ \u0410 \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0430\u043c\u0438,                       \/\/ \u043e \u043d\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435    ],   controllers: [AppController],   providers: [AppService], }) export class AppModule { } <\/code><\/pre>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c (\u043a\u043b\u0430\u0441\u0441) TypeOrmModule, \u0432\u044b\u0437\u0432\u0430\u0432 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 forRoot() \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u0438\u043f\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0441\u043c. \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442):<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 forRoot()<\/figcaption><\/figure>\n<p>\u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0411\u0414. <\/p>\n<p>\u0412 \u0441\u0430\u043c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 forRoot() \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0442\u0438\u043f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0421\u0423\u0411\u0414 (sqlite) \u0438 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 <strong>test_db.sqlite<\/strong> (\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 synchronize \u0438 <a href=\"https:\/\/docs.nestjs.com\/techniques\/database#auto-load-entities\" rel=\"noopener noreferrer nofollow\">autoLoadEntities<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/typeorm.io\/data-source-options\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"document-module-creation\" id=\"document-module-creation\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/h2>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 NestJS \u0438\u043c\u0435\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043c\u043d\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/domclick\/blog\/567816\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> (\u043e\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0412\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439).<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0444\u0430\u0439\u043b <strong>app.module.ts<\/strong>). \u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f Nest CLI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>nest g module documents:<\/code><\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f documents<\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0440\u0438\u0441\u0443\u043d\u043a\u0430 \u2014 \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u0430\u043f\u043a\u0443 documents \u0432 \u043f\u0430\u043f\u043a\u0435 src, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0442\u0443\u0434\u0430 \u0444\u0430\u0439\u043b <strong>documents.module.ts<\/strong> \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>app.module.ts<\/strong>. \u0412\u043e\u0442 \u044d\u0442\u0438 <a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/2a6339319253ba03cec8f350d88f882ca6f95ad2\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <strong>src\/documents\/entities<\/strong> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u044f Document (\u0445\u043e\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430), \u0430 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u2014 \u0444\u0430\u0439\u043b <strong>document.entity.ts<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"typescript\">import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';  @Entity() export class Document {   @PrimaryGeneratedColumn()   id: Number;    @Column({ length: 100, unique: true })   cipher: String;    @Column()   createdOn: Date;    @Column()   inArchive: Boolean; } <\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b, \u044f \u0434\u0443\u043c\u0430\u044e \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0412\u0430\u043c \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0438\u0442\u044c <a href=\"https:\/\/typeorm.io\/entities\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0438 \u043f\u043e TypeORM<\/a> \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 =).<\/p>\n<p><a href=\"https:\/\/github.com\/greenDev7\/grid-component-backend\/commit\/a04322c10264e32fa048a78c33da61e37817befb\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c<\/a> \u044d\u0442\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 document:<\/p>\n<pre><code class=\"typescript\">import { Module } from '@nestjs\/common'; import { TypeOrmModule } from '@nestjs\/typeorm'; import { Document } from '.\/entities\/document.entity';  @Module({     imports: [TypeOrmModule.forFeature([Document])], }) export class DocumentsModule {}<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 hot reload \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 <strong>test_db.sqlite<\/strong>.<\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0411\u0414 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 document \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0411\u0414<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 sqlite3. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/linuxhint.com\/install-sqlite-ubuntu-linux-mint\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>sqlite3 test_db.sqlite<\/code><\/p>\n<figure class=\"bordered full-width\"><figcaption>sqlite3 command line shell<\/figcaption><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>.database<\/code> \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u0439 \u0411\u0414:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0412\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0411\u0414<\/figcaption><\/figure>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>.fullschema<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (DDL) \u0441 \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b .fullschema<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0438\u0434\u0435\u0442 \u043f\u043e \u043f\u043b\u0430\u043d\u0443.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<figure class=\"bordered full-width\"><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"controller-and-service-creation\" id=\"controller-and-service-creation\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u043e\u0433\u043e RESTfull \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b. \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0432 NestJS <a href=\"https:\/\/docs.nestjs.com\/controllers\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b<\/a> \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 (URI), \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e web-\u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Postman, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0435\u0449\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0411\u0414, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439, \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442.\u0434. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0438\u043d\u043e\u0433\u0434\u0430 (\u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e!) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0442\u0438\u043f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0434\u0440. \u0421\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0438\u0445 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u2014 \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\/\u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0442.\u043d. <a href=\"https:\/\/ru.wikipedia.org\/wiki\/API\" rel=\"noopener noreferrer nofollow\">API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/a> \u0412\u0430\u0448\u0435\u0433\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-337886","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337886","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=337886"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337886\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}