{"id":366340,"date":"2024-05-21T02:57:10","date_gmt":"2024-05-21T02:57:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=366340"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T02:57:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=366340","title":{"rendered":"<span>\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442 NestJS-mod \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0430 NestJS<\/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<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/d95\/ad6\/1ef\/d95ad61ef2ee0b639bb7e0a1f4f8a0d7.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d95\/ad6\/1ef\/d95ad61ef2ee0b639bb7e0a1f4f8a0d7.png\"\/><\/figure>\n<h2>\u041e \u0441\u0435\u0431\u0435<\/h2>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0418\u043b\u044c\u0448\u0430\u0442.<br \/> \u042f \u043f\u0438\u0448\u0443 \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0430 Typescript \u0438 NestJS \u0443\u0436\u0435 7 \u043b\u0435\u0442.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0431\u044d\u043a\u044d\u043d\u0434\u0430 \u044f \u043f\u0438\u0448\u0443 \u0435\u0449\u0451 \u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043d\u0430 Angular, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 NestJS \u0438 Angular \u044f \u0438 \u0432\u044b\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e Typescript \u0441\u0442\u0430\u043b \u043c\u043e\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>NestJS \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 NestJS.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0434\u043d\u0430, \u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439, \u0434\u0435\u043f\u043b\u043e\u0435\u043c \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0447\u0430\u0441\u044b.<\/p>\n<p>\u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445, \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043a\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0437\u044a\u0435\u0437\u0436\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0434\u0435\u0432\u043e\u043f\u0441 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0438\u043b\u0438 \u0446\u0435\u043b\u044b\u0439 \u043e\u0442\u0434\u0435\u043b \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441c\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u0435\u0432\u043e\u043f\u0441 \u0432\u0437\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0431\u044f, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443, \u0435\u0449\u0451 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u043f\u0446\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0422\u0430\u043a-\u043a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 NestJS, \u044f \u0437\u043d\u0430\u044e \u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043d\u043e \u0434\u043b\u044f \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0435\u0432\u043e\u043f\u0441 \u043f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b\u0430.<\/p>\n<p>\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442 NestJS-mod \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 (System, Core, Feature, Integration, Infrastructure).<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0415\u0434\u0438\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f, \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u0441\u0430\u043c\u043e NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>NestJS-mod \u043c\u043e\u0434\u0443\u043b\u0438 \u0441\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<h2>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442<\/h2>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 nx \u043f\u0440\u043e\u0435\u043a\u0442 npx --yes create-nx-workspace@17.2.8 --name=project-name --preset=empty --interactive=false --nx-cloud=false  # \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 cd project-name  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f npm install --save-dev @nestjs-mod\/schematics@latest  # \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 NestJS-mod .\/node_modules\/.bin\/nx g @nestjs-mod\/schematics:application --directory=apps\/app-name --name=app-name --projectNameAndRootFormat=as-provided --strict=true  # \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b npm run manual:prepare  # \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 watch-\u0440\u0435\u0436\u0438\u043c\u0435 npm run serve:dev:app-name <\/code><\/pre>\n<h2>\u0422\u0438\u043f\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f NestJS \u0432\u0441\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043e\u043f\u0446\u0438\u044e imports \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0434\u0443\u0442 \u0435\u0434\u0438\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0430 \u043a\u0430\u043a\u043e\u0439 \u043d\u0435\u0441\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>NestJS-mod \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043e\u0434\u043d\u0443 \u043e\u0431\u0449\u0443\u044e \u043e\u043f\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043e\u0442\u0447\u0451\u0442\u0430 \u043f\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0430\u043c\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d.<\/p>\n<pre><code class=\"typescript\">import { bootstrapNestApplication } from \"@nestjs-mod\/common\";  bootstrapNestApplication({   modules: {     system: [],     core: [],     feature: [],     integrations: [],     infrastructure: [],   }, }); <\/code><\/pre>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: 1) system, 2) core, 3) feature, 4) integrations, 5) infrastructure<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (System)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS, \u0437\u0430\u043f\u0443\u0441\u043a \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0442. \u0434.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430 (Core)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0442\u0438\u043f\u043e\u043c \u201c\u042f\u0434\u0440\u043e\u201d \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a aws \u0438 \u0442. \u0434.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (Feature)<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 (\u201c\u0444\u0438\u0447\u0430\u201d) \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (Integration)<\/h3>\n<p>\u201c\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435\u201d \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u044f\u0434\u0440\u0430.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>UsersModule<\/code> \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0438\u043f \u043c\u043e\u0434\u0443\u043b\u044f \u201cFeature\u201d \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u043f\u0438\u0441\u044c\u043c\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>NotificationsModule<\/code> \u0441 \u0442\u0438\u043f\u043e\u043c \u201cCore\u201d, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0435 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u044e\u0437\u0435\u0440\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a\u0430\u043a \u0438 \u044f\u0432\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043c\u043e\u0434\u0443\u043b\u044c \u044e\u0437\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>afterCreateUser<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0438\u0437 \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (Infrastructure)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 NestJS.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u0444\u0430\u0439\u043b <code>docker-compose<\/code> \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>gitlab<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 NestJS-mod.<\/p>\n<\/blockquote>\n<h2>\u0423\u0442\u0438\u043b\u0438\u0442\u044b<\/h2>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f (Config model)<\/h3>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b <code>ConfigModel<\/code>, <code>ConfigModelProperty<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>configTransform<\/code> \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439<\/h4>\n<pre><code class=\"typescript\">import {   ConfigModel,   ConfigModelProperty,   configTransform, } from \"@nestjs-mod\/common\"; import { DynamicModule, Module } from \"@nestjs\/common\"; import { NestFactory } from \"@nestjs\/core\"; import { IsNotEmpty } from \"class-validator\";  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 @ConfigModel() class AppConfig {   @ConfigModelProperty()   @IsNotEmpty()   option!: string; }  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 forRoot @Module({ providers: [AppConfig] }) class AppModule {   static forRoot(config: Partial&lt;AppConfig>): DynamicModule {     return {       module: AppModule,       providers: [         {           provide: `${AppConfig.name}_loader`,           useFactory: async (emptyAppConfig: AppConfig) => {             if (config.constructor !== Object) {               Object.setPrototypeOf(emptyAppConfig, config);             }             const obj = await configTransform({               model: AppConfig,               data: config,             });             Object.assign(emptyAppConfig, obj.data);           },           inject: [AppConfig],         },       ],     };   } }  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c async function bootstrap1() {   const app = await NestFactory.create(AppModule.forRoot({}));   await app.listen(3000); }  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \/\/ throw new ConfigModelValidationErrors(validateErrors); \/\/ isNotEmpty: option should not be empty bootstrap1();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 async function bootstrap2() {   const app = await NestFactory.create(AppModule.forRoot({ option: \"value1\" }));   console.log(app.get(AppConfig)); \/\/ output: { option: 'value1' }   await app.listen(3000); }  \/\/ \u041e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442 bootstrap2(); <\/code><\/pre>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (Env model)<\/h3>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b <code>EnvModel<\/code>, <code>EnvModelProperty<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>envTransform<\/code> \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b \u0438\u0437 <code>process.env<\/code> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/www.vaultproject.io\" rel=\"noopener noreferrer nofollow\">https:\/\/www.vaultproject.io<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/developer.hashicorp.com\/consul\/docs\/dynamic-app-config\/kv\" rel=\"noopener noreferrer nofollow\">https:\/\/developer.hashicorp.com\/consul\/docs\/dynamic-app-config\/kv<\/a>.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h4>\n<pre><code class=\"typescript\">import { EnvModel, EnvModelProperty, envTransform } from \"@nestjs-mod\/common\"; import { DynamicModule, Module } from \"@nestjs\/common\"; import { NestFactory } from \"@nestjs\/core\"; import { IsNotEmpty } from \"class-validator\";  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f @EnvModel() class AppEnv {   @EnvModelProperty()   @IsNotEmpty()   option!: string; }  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 forRoot @Module({ providers: [AppEnv] }) class AppModule {   static forRoot(env: Partial&lt;AppEnv>): DynamicModule {     return {       module: AppModule,       providers: [         {           provide: `${AppEnv.name}_loader`,           useFactory: async (emptyAppEnv: AppEnv) => {             if (env.constructor !== Object) {               Object.setPrototypeOf(emptyAppEnv, env);             }             const obj = await envTransform({               model: AppEnv,               data: env,             });             Object.assign(emptyAppEnv, obj.data);           },           inject: [AppEnv],         },       ],     };   } }  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 process.env async function bootstrap1() {   const app = await NestFactory.create(AppModule.forRoot({}));   await app.listen(3000); }  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \/\/ throw new ConfigModelValidationErrors(validateErrors); \/\/ isNotEmpty: option should not be empty bootstrap1();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, process.env \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u0443\u0441\u0442\u043e\u0439 async function bootstrap2() {   const app = await NestFactory.create(AppModule.forRoot({ option: \"value1\" }));   console.log(app.get(AppEnv)); \/\/ output: { option: 'value1' }   await app.listen(3000); }  \/\/ \u041e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442 bootstrap2();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0430 \u043b\u043e\u0436\u0438\u043c \u0438\u0445 \u0432 process.env async function bootstrap3() {   process.env[\"OPTION\"] = \"value1\";   const app = await NestFactory.create(AppModule.forRoot({}));   console.log(app.get(AppEnv)); \/\/ output: { option: 'value1' }   await app.listen(3000); }  \/\/ \u041e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442 bootstrap3(); <\/code><\/pre>\n<h4>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u043f\u043e\u043b\u0435\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440\u043e\u0432 (formatters).<\/h4>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440 &#8212; \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0438\u0437 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043c\u043e\u0434\u0443\u043b\u044f, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0443\u043b\u044f (\u043f\u0440\u0438\u043c\u0435\u0440: &lt;PROJECT<em>NAME><\/em>&lt;CONTEXT<em>NAME><\/em>&lt;MODULE<em>NAME><\/em>&lt;PROPERTY_NAME>). (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/master\/libs\/common\/src\/lib\/env-model\/formatters\/dot-env-property-name.formatter.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440 &#8212; \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440\u0430 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 &lt;PROJECT<em>NAME><\/em>&lt;CONTEXT<em>NAME><\/em>&lt;MODULE<em>NAME>_STATIC_STRING<\/em>&lt;PROPERTY_NAME>) (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-contrib\/blob\/master\/libs\/core\/prisma\/src\/lib\/formatters\/dot-env-property-name.formatter.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>)<\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u043a\u0441\u0442\u0440\u0430\u043a\u0442\u043e\u0440\u043e\u0432 (extractors), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440\u044b.<\/h4>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u043a\u0441\u0442\u0440\u0430\u043a\u0442\u043e\u0440 &#8212; \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0438\u0437 \u043e\u0431\u044c\u0435\u043a\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432 \u0444\u0443\u043d\u043a\u0438\u0446\u044e <code>configTransform<\/code> (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/master\/libs\/common\/src\/lib\/env-model\/extractors\/default-property-value.extractor.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>)<\/p>\n<\/li>\n<li>\n<p><code>process.env<\/code> \u044d\u043a\u0441\u0442\u0440\u0430\u043a\u0442\u043e\u0440 &#8212; \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/master\/libs\/common\/src\/lib\/env-model\/extractors\/process-env-property-value.extractor.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>)<\/p>\n<\/li>\n<\/ul>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NestJS-mod \u043c\u043e\u0434\u0443\u043b\u044f (createNestModule)<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>createNestModule<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e NestJS \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <code>forFeature<\/code> \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438\u0437 \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>\u0412\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043c\u0435\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0432 \u043e\u043f\u0446\u0438\u044e <code>contextName<\/code>.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 NestJS \u043c\u043e\u0434\u0443\u043b\u0435\u0439, NestJS-mod \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e NestJS \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 createNestModule \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439<\/h3>\n<pre><code class=\"typescript\">import {   ConfigModel,   ConfigModelProperty,   EnvModel,   EnvModelProperty,   createNestModule,   getNestModuleDecorators,   InjectableFeatureConfigurationType, } from \"@nestjs-mod\/common\"; import { Injectable } from \"@nestjs\/common\"; import { NestFactory } from \"@nestjs\/core\"; import { IsNotEmpty } from \"class-validator\";  \/\/ App1Module  const { InjectFeatures } = getNestModuleDecorators({   moduleName: \"App1Module\", });  @ConfigModel() class AppFeatureConfig {   @ConfigModelProperty()   @IsNotEmpty()   featureOptionConfig!: string; }  @Injectable() class AppFeaturesService {   constructor(     @InjectFeatures()     private readonly appFeatureConfigs: InjectableFeatureConfigurationType&lt;AppFeatureConfig>[]   ) {}    getFeatureConfigs() {     return this.appFeatureConfigs.map(       ({ featureConfiguration }) => featureConfiguration     );   } }  const { App1Module } = createNestModule({   moduleName: \"App1Module\",   sharedProviders: [AppFeaturesService],   featureConfigurationModel: AppFeatureConfig, });  @ConfigModel() class App2Config {   @ConfigModelProperty()   @IsNotEmpty()   option!: string; }  @Injectable() class App2Service {   constructor(     private readonly appFeaturesService: AppFeaturesService,     private readonly app2Config: App2Config   ) {}    getFeatureConfigs() {     return this.appFeaturesService.getFeatureConfigs();   }    getConfig() {     return this.app2Config;   } }  \/\/ App2Module  const { App2Module } = createNestModule({   moduleName: \"App2Module\",   imports: [     App1Module.forFeature({       featureModuleName: \"App2Module\",       featureConfiguration: { featureOptionConfig: \"featureOptionConfig-app2\" },     }),   ],   providers: [App2Service],   configurationModel: App2Config, });  @EnvModel() class App3Env {   @EnvModelProperty()   @IsNotEmpty()   option!: string; }  @Injectable() class App3Service {   constructor(     private readonly appFeaturesService: AppFeaturesService,     private readonly app3Env: App3Env   ) {}    getFeatureConfigs() {     return this.appFeaturesService.getFeatureConfigs();   }    getEnv() {     return this.app3Env;   } }  const { App3Module } = createNestModule({   moduleName: \"App3Module\",   imports: [     App1Module.forFeature({       featureModuleName: \"App2Module\",       featureConfiguration: { featureOptionConfig: \"featureOptionConfig-app3\" },     }),   ],   providers: [App3Service],   environmentsModel: App3Env, });  \/\/ Test  const { AppModule } = createNestModule({   moduleName: \"AppModule\",   imports: [     App1Module.forRoot(),     App2Module.forRoot({ configuration: { option: \"appConfig3value\" } }),     App3Module.forRoot({ environments: { option: \"appEnv2value\" } }),   ], });  async function bootstrap() {   const app = await NestFactory.create(AppModule.forRoot());   const appFeatureScannerService = app.get(AppFeaturesService);   const app2Service = app.get(App2Service);   const app3Service = app.get(App3Service);    console.log(appFeatureScannerService.getFeatureConfigs()); \/\/ output: [{ featureOptionConfig: 'featureOptionConfig-app2' }, { featureOptionConfig: 'featureOptionConfig-app3' }]   console.log(app2Service.getFeatureConfigs()); \/\/ output: [{ featureOptionConfig: 'featureOptionConfig-app2' }, { featureOptionConfig: 'featureOptionConfig-app3' }]   console.log(app3Service.getFeatureConfigs()); \/\/ output: [{ featureOptionConfig: 'featureOptionConfig-app2' }, { featureOptionConfig: 'featureOptionConfig-app3' }]   console.log(app2Service.getConfig()); \/\/ output: { option: 'appConfig3value' }   console.log(app3Service.getEnv()); \/\/ output: { option: 'appEnv2value' } }  bootstrap(); <\/code><\/pre>\n<h4>\u041c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u0435\u0440\u0442\u043a\u0438<\/h4>\n<p>\u042d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>bootstrapNestApplication<\/code> \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS-mod, \u043e\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<ul>\n<li>\n<p>preWrapApplication &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443 \u0432\u0441\u0435\u0445 \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0442\u0443\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043a\u043b\u044e\u0447\u0435\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/8ab5dc5a340215bdba8cea63e004dea2c3676e95\/libs\/common\/src\/lib\/modules\/system\/project-utils\/project-utils.module.ts#L50\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/a>)<\/p>\n<\/li>\n<li>\n<p>wrapApplication &#8212; \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/8ab5dc5a340215bdba8cea63e004dea2c3676e95\/libs\/common\/src\/lib\/modules\/system\/default-nest-application\/default-nest-application-initializer.ts#L106\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/a>)<\/p>\n<\/li>\n<li>\n<p>postWrapApplication &#8212; \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u043a\u0443 HTTP-\u043f\u043e\u0440\u0442\u0430 (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/blob\/8ab5dc5a340215bdba8cea63e004dea2c3676e95\/libs\/common\/src\/lib\/modules\/system\/default-nest-application\/default-nest-application-listener.ts#L79\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/a>)<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 NestJS \u0442\u0430\u043a \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043e\u043f\u0446\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0430\u0445, \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0441\u043f\u0438\u0448\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<h4>\u041e\u043f\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NestJS-mod \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p><strong>environmentsModel<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0438 \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 \u201c\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u201d (Env model), \u0432 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: <code>process.env<\/code> \u0438\u043b\u0438 <code>consul-kv<\/code>.<\/p>\n<p><strong>configurationModel<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0438 \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 \u201c\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u201d (Config model), \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p><strong>staticEnvironmentsModel<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u201c\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u201d (Env model) \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>process.env<\/code> \u0438\u043b\u0438 <code>consul-kv<\/code>.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u043e\u0443\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 REST.<\/p>\n<\/blockquote>\n<p><strong>staticConfigurationModel<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f (\u0438\u043c\u043f\u043e\u0440\u0442\u044b, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<p><strong>featureEnvironmentsModel<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u201c\u0444\u0438\u0447\u0430\u201d \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: <code>process.env<\/code> \u0438\u043b\u0438 <code>consul-kv<\/code>.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d\u0430.<\/p>\n<\/blockquote>\n<p><strong>featureConfigurationModel<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u201c\u0444\u0438\u0447\u0430\u201d \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u044b\u0439 \u201c\u0444\u0438\u0447\u0430\u201d \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0430\u0434\u0440\u0435\u0441\u0430\u0442\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u201c\u044f\u0434\u0440\u043e\u043c\u201d \u0438\u043b\u0438 \u201c\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u201d \u043c\u043e\u0434\u0443\u043b\u0435\u043c.<\/p>\n<\/blockquote>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0444\u0430\u0431\u0440\u0438\u043a\u0438, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0446\u0438\u044e <code>imports<\/code>, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c NestJS.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0444\u0430\u0431\u0440\u0438\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0432\u0441\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c NestJS.<\/p>\n<p>\u0412 NestJS-mod \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 Observable \u043f\u043e\u0442\u043e\u043a\u0430 \u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043c\u0435\u043d\u044b \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u043a\u0440\u0435\u0434\u043e\u0432 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e, \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u043a\u0440\u0435\u0434\u043e\u0432, \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f.<\/p>\n<\/blockquote>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0444\u0438\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438)<\/h4>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 NestJS \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 (\u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043d\u0433\u0430) \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u0441\u044f, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u201c\u0444\u0438\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u201d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 NestJS \u0445\u0443\u043a\u0435 <code>onApplicationBootstrap<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <code>InjectFeatures<\/code>.<br \/> \u0412 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u0440\u0430\u043d\u0442\u0430\u0439\u043c) \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c \u0443\u0436\u0435 \u043d\u0435\u0442.<\/p>\n<h4>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p>\u0422\u0430\u043a-\u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>getNestModuleDecorators<\/code><\/p>\n<h4>\u0422\u0438\u043f\u044b \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u0432:<\/h4>\n<p><strong>InjectService<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043f\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443 \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0443.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0435\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u043e \u0432 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<\/blockquote>\n<p><strong>InjectFeatures<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0415\u0441\u0442\u044c \u201c\u0441\u0438\u0441\u0442\u0435\u043c\u201d \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430 \u0438 \u0435\u0441\u0442\u044c \u0444\u0438\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0434\u0443\u043b\u044c \u201c\u044f\u0434\u0440\u0430\u201d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c \u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u201c\u0441\u0438\u0441\u0442\u0435\u043c\u201d \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 &#8212; \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u044e\u0434\u0435\u0439 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434.<\/p>\n<\/blockquote>\n<p><strong>InjectAllFeatures<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438 \u0442\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u201c\u0444\u0438\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439\u201d \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440.<\/p>\n<p><strong>InjectFeatureEnvironments<\/strong><\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043d\u0435\u043a\u043e\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0443\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u201c\u0441\u0438\u0441\u0442\u0435\u043c\u201d \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441 \u0441\u0430\u043c\u0438\u0445 \u0444\u0438\u0447\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/blockquote>\n<p><strong>InjectAllFeatureEnvironments<\/strong><\/p>\n<p>\u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 <code>InjectFeatureEnvironments<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u0441\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p><strong>InjectModuleSettings<\/strong><\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f, \u044d\u0442\u043e \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u043e\u0442\u0447\u0451\u0442 .<\/p>\n<\/blockquote>\n<p><strong>InjectAllModuleSettings<\/strong><\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u042d\u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>bootstrapNestApplication<\/code>, \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0430\u043f\u043f\u0435\u0440 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<pre><code class=\"typescript\">import {   DefaultNestApplicationInitializer,   DefaultNestApplicationListener,   EnvModel,   EnvModelProperty,   bootstrapNestApplication,   createNestModule, } from \"@nestjs-mod\/common\"; import { Injectable, Logger } from \"@nestjs\/common\"; import { IsNotEmpty } from \"class-validator\";  @EnvModel() class AppEnv {   @EnvModelProperty()   @IsNotEmpty()   option!: string; }  @Injectable() class AppService {   constructor(private readonly appEnv: AppEnv) {}    getEnv() {     return this.appEnv;   } }  const { AppModule } = createNestModule({   moduleName: \"AppModule\",   environmentsModel: AppEnv,   providers: [AppService], });  process.env[\"OPTION\"] = \"value1\";  const globalPrefix = \"api\";  bootstrapNestApplication({   modules: {     system: [       DefaultNestApplicationInitializer.forRoot(),       DefaultNestApplicationListener.forRoot({         staticEnvironments: { port: 3000 },         staticConfiguration: {           preListen: async ({ app }) => {             if (app) {               const appService = app.get(AppService);               console.log(appService.getEnv()); \/\/ output: { option: 'value1' }               app.setGlobalPrefix(globalPrefix);             }           },           postListen: async ({ current }) => {             Logger.log(               `? Application is running on: http:\/\/${                 current.staticEnvironments?.hostname ?? \"localhost\"               }:${current.staticEnvironments?.port}\/${globalPrefix}`             );           },         },       }),     ],     feature: [AppModule.forRoot()],   }, }); <\/code><\/pre>\n<h2>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438<\/h2>\n<p>\u0426\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u0438\u043f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NestJS-mod \u044d\u0442\u043e \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 <a href=\"https:\/\/nx.dev\" rel=\"noopener noreferrer nofollow\">https:\/\/nx.dev<\/a>.<\/p>\n<p>\u0422\u0430\u043a-\u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d NestJS-mod \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 nx, \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0430\u0439\u043f\u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0430, \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043d\u0430\u0431\u043e\u0440\u044b \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432 <a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/schematics\" rel=\"noopener noreferrer nofollow\">@nestjs-mod\/schematics<\/a> \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<h4>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 nx \u043f\u0440\u043e\u0435\u043a\u0442 npx --yes create-nx-workspace@17.2.8 --name=project-name --preset=empty --interactive=false --nx-cloud=false  # \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 cd project-name  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f npm install --save-dev @nestjs-mod\/schematics@latest  # \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 NestJS-mod .\/node_modules\/.bin\/nx g @nestjs-mod\/schematics:application --directory=apps\/app-name --name=app-name --projectNameAndRootFormat=as-provided --strict=true <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: <a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/apps\/app-name\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/apps\/app-name<\/a><\/p>\n<\/blockquote>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/h4>\n<pre><code class=\"bash\"># \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b npm run manual:prepare  # \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 watch-\u0440\u0435\u0436\u0438\u043c\u0435 npm run serve:dev:app-name <\/code><\/pre>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u0440\u0435\u0436\u0438\u043c\u0435<\/h4>\n<pre><code class=\"bash\">## \u0421\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f npm run build:prod:app-name  ## \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f npm run start:prod:app-name <\/code><\/pre>\n<h4>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b:<\/h4>\n<ul>\n<li>\n<p>Pino &#8212; \u043b\u043e\u0433\u0433\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0433\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432, \u0441\u0430\u0439\u0442: <a href=\"https:\/\/github.com\/pinojs\/pino\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pinojs\/pino<\/a>.<\/p>\n<\/li>\n<li>\n<p>Terminus &#8212; \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u0430\u0439\u0442: <a href=\"https:\/\/docs.nestjs.com\/recipes\/terminus\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.nestjs.com\/recipes\/terminus<\/a>.<\/p>\n<\/li>\n<li>\n<p>InfrastructureMarkdownReportGenerator &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 (<a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/blob\/master\/apps\/app-name\/INFRASTRUCTURE.MD\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>).<\/p>\n<\/li>\n<li>\n<p>PM2 &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u0430\u0439\u0442: <a href=\"https:\/\/pm2.keymetrics.io\/\" rel=\"noopener noreferrer nofollow\">https:\/\/pm2.keymetrics.io\/<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 NestJS-mod<\/h3>\n<h4>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h4>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 NestJS-mod \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 .\/node_modules\/.bin\/nx g @nestjs-mod\/schematics:library feature-name --buildable --publishable --directory=libs\/feature-name --simpleName=true --projectNameAndRootFormat=as-provided --strict=true <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/libs\/feature-name\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/libs\/feature-name<\/a><\/p>\n<\/blockquote>\n<h4>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b:<\/h4>\n<ul>\n<li>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0434\u043b\u044f Github &#8212; action: <a href=\"https:\/\/github.com\/TheUnderScorer\/nx-semantic-release\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/TheUnderScorer\/nx-semantic-release<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0441\u0442\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f &#8212; \u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/libs\/feature-name\/src\/lib\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\/tree\/master\/libs\/feature-name\/src\/lib<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 NestJS \u0438 NestJS-mod \u043c\u043e\u0434\u0443\u043b\u0438<\/h3>\n<h4>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/h4>\n<ul>\n<li>\n<p>DefaultNestApplicationInitializer &#8212; \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/common#defaultnestapplicationinitializer\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>DefaultNestApplicationListener &#8212; \u041f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 NestJS \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/common#defaultnestapplicationlistener\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>ProjectUtils &#8212; \u0423\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/common#projectutils\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>NestjsPinoLogger &#8212; Pino \u043b\u043e\u0433\u0435\u0440 (\u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f <a href=\"https:\/\/www.npmjs.com\/package\/nestjs-pino\" rel=\"noopener noreferrer nofollow\">https:\/\/www.npmjs.com\/package\/nestjs-pino<\/a>, (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/pino#nestjspinologger\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>TerminusHealthCheck &#8212; \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 NestJS \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/terminus#terminushealthcheck\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>DefaultTestNestApplicationCreate &#8212; \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/testing#defaulttestnestapplicationcreate\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>DefaultTestNestApplicationInitializer &#8212; \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 NestJS (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/testing#defaulttestnestapplicationinitializer\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430<\/h4>\n<ul>\n<li>\n<p>PrismaModule &#8212; \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Prisma-\u043e\u0440\u043c (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/prisma#prismamodule\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<ul>\n<li>\n<p>DockerCompose &#8212; \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 docker compose \u0444\u0430\u0439\u043b\u0430 (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/docker-compose#dockercompose\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>DockerComposePostgreSQL &#8212; \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f docker compose \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 postgres, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d DockerCompose \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e compose \u0444\u0430\u0439\u043b\u0430 (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/docker-compose#dockercomposepostgresql\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>Pm2 &#8212; \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 PM2 (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/pm2#pm2\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<li>\n<p>NestjsModAllReadmeGenerator &#8212; \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 (<a href=\"https:\/\/www.npmjs.com\/package\/@nestjs-mod\/reports#nestjsmodallreadmegenerator\" rel=\"noopener noreferrer nofollow\">\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a>).<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435<\/h3>\n<ul>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c &#8212; \u0442\u0430\u043a-\u043a\u0430\u043a \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0435\u0431\u0435 \u043d\u0435\u043a\u0438\u0439 \u0434\u0435\u0434\u043b\u0430\u0439\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043c\u043e\u0433 \u0432\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u043b\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b &#8212; \u0442\u0435\u0441\u0442\u044b \u0435\u0441\u0442\u044c \u043d\u0435 \u043d\u0430 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0442\u0438\u043b\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0430 \u043d\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0441\u0442\u044b. \u041c\u043e\u0434\u0443\u043b\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-contrib\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-contrib<\/a> \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432, \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0443\u0442\u0438\u043b\u0438\u0442 &#8212; \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0432 readme \u0444\u0430\u0439\u043b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0432\u0435\u0449\u0451\u0439 (\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Redis, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Nodemailer \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 gitlab-ci, bitbucket, jenkins<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u043a\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Kubernetes.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0438 \u0438\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 package.json \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0438\u043c\u0435\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 package.json \u0438 .env \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042f \u043d\u0435 \u0437\u043d\u0430\u044e \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043d\u0435\u0439 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 NestJS, \u043d\u043e \u044f \u0441\u0430\u043c \u0432\u0441\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u0447\u0430\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 NestJS-mod, \u0442\u0430\u043a-\u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0443\u043c\u0440\u0435\u0442 ?<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod<\/a> &#8212; \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f NestJS-mod \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 NestJS.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-contrib\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-contrib<\/a> &#8212; \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 NestJS \u0438 NestJS-mod \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0432\u0440\u0430\u043f\u043f\u0435\u0440\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod-example\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nestjs-mod\/nestjs-mod-example<\/a> &#8212; \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/github.com\/nestjs-mod\/nestjs-mod\/tree\/master\/libs\/schematics\" rel=\"noopener noreferrer nofollow\">@nestjs-mod\/schematics<\/a> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<h3>P.S.<\/h3>\n<p>\u041d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u0431\u044b\u043b \u0441\u043a\u043e\u0440\u0435\u0439\u0448\u0438\u0439 \u0432\u044b\u043f\u0443\u0441\u043a \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0435\u043a\u043e\u0439 MVP \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0432 open source \u0438 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438 \u0432\u0440\u0435\u043c\u044f \u0442\u043e \u044f \u0431\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0434 \u043d\u043e\u0432\u044b\u043c \u043f\u0443\u043b\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u043c \u0438 \u043d\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u0435\u0431\u044c\u044e\u0442\u0435\u0440\u0430\u043c.<\/p>\n<p>\u0425\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"https:\/\/github.com\/ArgoN1ck\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/ArgoN1ck<\/a> \u0437\u0430 \u0438\u043a\u043e\u043d\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 ? \u0438 \u0441\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"https:\/\/github.com\/AleksandrAlyokhin\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AleksandrAlyokhin<\/a> \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 ?<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/788916\/\"> https:\/\/habr.com\/ru\/articles\/788916\/<\/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<figure class=\"\"><\/figure>\n<h2>\u041e \u0441\u0435\u0431\u0435<\/h2>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0418\u043b\u044c\u0448\u0430\u0442.<br \/> \u042f \u043f\u0438\u0448\u0443 \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0430 Typescript \u0438 NestJS \u0443\u0436\u0435 7 \u043b\u0435\u0442.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0431\u044d\u043a\u044d\u043d\u0434\u0430 \u044f \u043f\u0438\u0448\u0443 \u0435\u0449\u0451 \u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043d\u0430 Angular, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 NestJS \u0438 Angular \u044f \u0438 \u0432\u044b\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e Typescript \u0441\u0442\u0430\u043b \u043c\u043e\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>NestJS \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 NestJS.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0434\u043d\u0430, \u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439, \u0434\u0435\u043f\u043b\u043e\u0435\u043c \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0447\u0430\u0441\u044b.<\/p>\n<p>\u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445, \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043a\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0437\u044a\u0435\u0437\u0436\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0434\u0435\u0432\u043e\u043f\u0441 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0438\u043b\u0438 \u0446\u0435\u043b\u044b\u0439 \u043e\u0442\u0434\u0435\u043b \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441c\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u0435\u0432\u043e\u043f\u0441 \u0432\u0437\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0431\u044f, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443, \u0435\u0449\u0451 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u043f\u0446\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0422\u0430\u043a-\u043a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 NestJS, \u044f \u0437\u043d\u0430\u044e \u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043d\u043e \u0434\u043b\u044f \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0435\u0432\u043e\u043f\u0441 \u043f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b\u0430.<\/p>\n<p>\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442 NestJS-mod \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 (System, Core, Feature, Integration, Infrastructure).<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0447\u0451\u0442 \u043f\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0415\u0434\u0438\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f, \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u0441\u0430\u043c\u043e NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>NestJS-mod \u043c\u043e\u0434\u0443\u043b\u0438 \u0441\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<h2>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442<\/h2>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 nx \u043f\u0440\u043e\u0435\u043a\u0442 npx --yes create-nx-workspace@17.2.8 --name=project-name --preset=empty --interactive=false --nx-cloud=false  # \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 cd project-name  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 NestJS-mod \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f npm install --save-dev @nestjs-mod\/schematics@latest  # \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 NestJS-mod .\/node_modules\/.bin\/nx g @nestjs-mod\/schematics:application --directory=apps\/app-name --name=app-name --projectNameAndRootFormat=as-provided --strict=true  # \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b npm run manual:prepare  # \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 watch-\u0440\u0435\u0436\u0438\u043c\u0435 npm run serve:dev:app-name <\/code><\/pre>\n<h2>\u0422\u0438\u043f\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f NestJS \u0432\u0441\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043e\u043f\u0446\u0438\u044e imports \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0434\u0443\u0442 \u0435\u0434\u0438\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0430 \u043a\u0430\u043a\u043e\u0439 \u043d\u0435\u0441\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>NestJS-mod \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043e\u0434\u043d\u0443 \u043e\u0431\u0449\u0443\u044e \u043e\u043f\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043e\u0442\u0447\u0451\u0442\u0430 \u043f\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0430\u043c\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d.<\/p>\n<pre><code class=\"typescript\">import { bootstrapNestApplication } from \"@nestjs-mod\/common\";  bootstrapNestApplication({   modules: {     system: [],     core: [],     feature: [],     integrations: [],     infrastructure: [],   }, }); <\/code><\/pre>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: 1) system, 2) core, 3) feature, 4) integrations, 5) infrastructure<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (System)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f NestJS, \u0437\u0430\u043f\u0443\u0441\u043a \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0442. \u0434.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430 (Core)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0442\u0438\u043f\u043e\u043c \u201c\u042f\u0434\u0440\u043e\u201d \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a aws \u0438 \u0442. \u0434.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (Feature)<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 (\u201c\u0444\u0438\u0447\u0430\u201d) \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (Integration)<\/h3>\n<p>\u201c\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435\u201d \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u044f\u0434\u0440\u0430.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>UsersModule<\/code> \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0438\u043f \u043c\u043e\u0434\u0443\u043b\u044f \u201cFeature\u201d \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u043f\u0438\u0441\u044c\u043c\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>NotificationsModule<\/code> \u0441 \u0442\u0438\u043f\u043e\u043c \u201cCore\u201d, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0435 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u044e\u0437\u0435\u0440\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a\u0430\u043a \u0438 \u044f\u0432\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043c\u043e\u0434\u0443\u043b\u044c \u044e\u0437\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>afterCreateUser<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0438\u0437 \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 NestJS \u0438 NestJS-mod.<\/p>\n<\/blockquote>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (Infrastructure)<\/h3>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 NestJS.<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b: \u0444\u0430\u0439\u043b <code>docker-compose<\/code> \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>gitlab<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/> \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 NestJS-mod.<\/p>\n<\/blockquote>\n<h2>\u0423\u0442\u0438\u043b\u0438\u0442\u044b<\/h2>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f (Config model)<\/h3>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b <code>ConfigModel<\/code>, <code>ConfigModelProperty<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>configTransform<\/code> \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439<\/h4>\n<pre><code class=\"typescript\">import {   ConfigModel,   ConfigModelProperty,   configTransform, } from \"@nestjs-mod\/common\"; import { DynamicModule, Module } from \"@nestjs\/common\"; import { NestFactory } from \"@nestjs\/core\"; import { IsNotEmpty } from \"class-validator\";  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 @ConfigModel() class AppConfig {   @ConfigModelProperty()   @IsNotEmpty()   option!: string; }  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 forRoot @Module({ providers: [AppConfig] }) class AppModule {   static forRoot(config: Partial&lt;AppConfig>): DynamicModule {     return {       module: AppModule,       providers: [         {           provide: `${AppConfig.name}_loader`,           useFactory: async (emptyAppConfig: AppConfig) => {             if (config.constructor !== Object) {               Object.setPrototypeOf(emptyAppConfig, config);             }             const obj = await configTransform({               model: AppConfig,               data: config,             });             Object.assign(emptyAppConfig, obj.data);           },           inject: [AppConfig],         },       ],     };   } }  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c async function bootstrap1() {   const app = await NestFactory.create(AppModule.forRoot({}));   await app.listen(3000); }  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \/\/ throw new ConfigModelValidationErrors(validateErrors); \/\/ isNotEmpty: option should not be empty bootstrap1();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 async function bootstrap2() {   const app = await NestFactory.create(AppModule.forRoot({ option: \"value1\" }));   console.log(app.get(AppConfig)); \/\/ output: { option: 'value1' }   await app.listen(3000); }  \/\/ \u041e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442 bootstrap2(); <\/code><\/pre>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (Env model)<\/h3>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b <code>EnvModel<\/code>, <code>EnvModelProperty<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>envTransform<\/code> \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b \u0438\u0437 <code>process.env<\/code> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/www.vaultproject.io\" rel=\"noopener noreferrer nofollow\">https:\/\/www.vaultproject.io<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/developer.hashicorp.com\/consul\/docs\/dynamic-app-config\/kv\" rel=\"noopener noreferrer nofollow\">https:\/\/developer.hashicorp.com\/consul\/docs\/dynamic-app-config\/kv<\/a>.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 NestJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h4>\n<pre><code class=\"typescript\">import { EnvModel, EnvModelProperty, envTransform } from \"@nestjs-mod\/common\"; import { DynamicModule, Module } from \"@nestjs\/common\"; import { NestFactory } from \"@nestjs\/core\"; import { IsNotEmpty } from \"class-validator\";  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f @EnvModel() class AppEnv {   @EnvModelProperty()   @IsNotEmpty()   option!: string; }  \/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 forRoot @Module({ providers: [AppEnv] }) class AppModule {   static forRoot(env: Partial&lt;AppEnv>): DynamicModule {     return {       module: AppModule,       providers: [         {           provide: `${AppEnv.name}_loader`,           useFactory: async (emptyAppEnv: AppEnv) => {             if (env.constructor !== Object) {               Object.setPrototypeOf(emptyAppEnv, env);             }             const obj = await envTransform({               model: AppEnv,               data: env,             });             Object.assign(emptyAppEnv, obj.data);           },           inject: [AppEnv],         },       ],     };   } }  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 process.env async function bootstrap1() {   const app = await NestFactory.create(AppModule.forRoot({}));   await app.listen(3000); }  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \/\/ throw new ConfigModelValidationErrors(validateErrors); \/\/ isNotEmpty: option should not be empty bootstrap1();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, process.env \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u0443\u0441\u0442\u043e\u0439 async function bootstrap2() {   const app = await NestFactory.create(AppModule.forRoot({ option: \"value1\" }));   console.log(app.get(AppEnv)); \/\/ output: { option: 'value1' }   await app.listen(3000); }  \/\/ \u041e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442 bootstrap2();  \/\/ \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c<\/code><\/pre>\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-366340","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/366340","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=366340"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/366340\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=366340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=366340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=366340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}