{"id":276076,"date":"2016-03-14T15:47:02","date_gmt":"2016-03-14T12:47:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=276076"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=276076","title":{"rendered":"\u0421\u0442\u0435\u043a MEAN. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f"},"content":{"rendered":"<p>       \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0441\u0442\u0435\u043a\u0435 MEAN (Mongo, Express, Angular, Node) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u043c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u043d\u043e\u0439) \u0442\u0435\u043c\u043e\u0439. \u041f\u0440\u043e\u0441\u0438\u043c \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043a\u043d\u0438\u0433\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u0442\u0435\u043a\u0435. \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441\u043e \u0441\u0442\u0435\u043a\u043e\u043c MEAN, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 JavaScript. \u041e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 JavaScript \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435, \u043d\u043e \u0438 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435. <\/p>\n<p>  <b>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/b><\/p>\n<p>  \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, MEAN \u2013 \u044d\u0442\u043e \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0430, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0442\u0440\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 JavaScript \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f NoSQL-\u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0418\u0442\u0430\u043a,<\/p>\n<p>  M \u2013 \u044d\u0442\u043e MongoDB<\/p>\n<p>  MongoDB \u2013 \u044d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0442\u0430\u043a \u0438 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0414\u0430\u043d\u043d\u044b\u0435 \u0432 MongoDB \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445, \u043a\u0430\u043a \u0432 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432 MongoDB \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f JSON-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0445\u0435\u043c\u0430\u043c\u0438.<\/p>\n<p>  E \u2013 \u044d\u0442\u043e ExpressJS<\/p>\n<p>  Express.js \u2013 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Node.js, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445, \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0438 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0414\u0435-\u0444\u0430\u043a\u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u0434\u043b\u044f node.js.<\/p>\n<p>  A \u2014 \u044d\u0442\u043e AngularJS<\/p>\n<p>  AngularJS \u2013 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0412 \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTML \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 HTML \u0434\u043b\u044f \u0447\u0435\u0442\u043a\u043e\u0433\u043e \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Angular \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u0430\u0441\u0441\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  N \u044d\u0442\u043e NodeJS<\/p>\n<p>  Node.js \u2013 \u044d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Node.js \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 JavaScript \u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 Node.js \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 OS X, Microsoft Windows, Linux, FreeBSD, NonStop, IBM AIX, IBM System z \u0438 IBM.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e01\/2a8\/ec4\/e012a8ec407c40cd8a958fdb3853ca3a.png\"\/><\/p>\n<p>  <b>\u0427\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 MEAN?<\/b><\/p>\n<p>  \u0422\u0435\u0440\u043c\u0438\u043d \u00ab\u0441\u0442\u0435\u043a MEAN\u00bb \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 JavaScript, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. MEAN \u2013 \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 MongoDB, ExpressJS, AngularJS \u0438 Node.js. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0441\u044c \u0441\u0442\u0435\u043a MEAN \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 JavaScript.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043e\u043d\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442. Angular \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u042f \u0431\u0443\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Angular.js \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043e\u043d\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044e Node.js, \u0442\u043e \u0435\u0441\u0442\u044c, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c Express.js. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Express \u044f \u043d\u0430\u043f\u0438\u0448\u0443 API \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c MongoDB \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430.<\/p>\n<p>  \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<p>  \u0421\u043f\u0435\u0440\u0432\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Node \u0438 MongoDB. \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/p>\n<p>  <a href=\"https:\/\/www.mongodb.org\/downloads#production\">\u0421\u043a\u0430\u0447\u0430\u0442\u044c Mongodb<\/a><\/p>\n<p>  <a href=\"https:\/\/nodejs.org\/en\/\">\u0421\u043a\u0430\u0447\u0430\u0442\u044c Node<\/a><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Visual Studio Code \u0432\u0435\u0440\u0441\u0438\u0438 0.9.2, \u043d\u043e \u0432\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c Sublime Text. \u041f\u0430\u043a\u0435\u0442\u044b \u0431\u0443\u0434\u0443 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/www.npmjs.com\/package\/npm\">Node Package Manager<\/a> \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 Windows. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 node cmd \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d nodejs.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0438<\/b><\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441\u0442\u0435\u043a\u0430 MEAN \u0438 Node, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0435 \u043f\u043e\u0434 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0430 stackoverflow. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. <\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430<\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c MeanApp. \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043b\u0435\u0436\u0430\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438. <\/p>\n<p>  \u041e\u043f\u0438\u0448\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438.   <\/p>\n<ol>\n<li>\u0412 <b>Angular<\/b> \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430: Controllers \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 angular, Modules \u0438 Models.<\/li>\n<li>\u0412 <b>Public<\/b> \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 javascript.<\/li>\n<li>\u0412 <b>Routes<\/b> \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c api expressjs api, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u043d\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 MongoDB.<\/li>\n<li>\u0412 <b>Views<\/b> \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0432\u0441\u0435 \u2013 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445.<\/li>\n<\/ol>\n<p>  \u0412 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c server.js \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<p>  \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 npm \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm install [package] --save<br \/>  <\/code><\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <\/p>\n<p>  <code>npm install express --save<br \/>  npm install path --save<br \/>  npm install morgan --save<br \/>  npm install cookie-parser --save<br \/>  npm install body-parser --save<br \/>  npm install bcrypt-nodejs --save<br \/>  npm install passport --save<br \/>  npm install passport-local --save<br \/>  npm install express-session --save<br \/>  npm install mongoose --save<br \/>  <\/code><\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b modules.js \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Angular\/Modules.<\/p>\n<pre><code class=\"javascript\">\/\/ \u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Angular  var main = angular.module(&quot;main&quot;, ['ui.router','ngRoute','ngResource']) .run(function($http,$rootScope) {     if(sessionStorage.length &gt; 0){         $rootScope.current_user = sessionStorage.current_user;         $rootScope.authenticated = true;     }else{         $rootScope.authenticated = false;         $rootScope.current_user = 'Guest';     }          $rootScope.signout = function(){         $http.get('auth\/signout');         $rootScope.authenticated = false;         $rootScope.current_user = 'Guest';         sessionStorage.clear();     };  });                                                                                                      \/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b) main.config([     '$stateProvider', '$urlRouterProvider', '$httpProvider',     function ($stateProvider, $urlRouterProvider,$rootScope) {         $urlRouterProvider.otherwise('\/');         $stateProvider             .state('home', {                 url: '\/',                 templateUrl: 'Index.html',                 caseInsensitiveMatch: true,                 controller: 'MainController'             })             .state('contact', {                 url: '\/contact',                 templateUrl: 'Contact.html',                 caseInsensitiveMatch: true,                 controller: 'MainController'             })             .state('about', {                 url: '\/about',                 templateUrl: 'About.html',                 caseInsensitiveMatch: true,                 controller: 'MainController'             })             .state('login',{                 url: '\/login',                 templateUrl: 'login.html',                 caseInsensitiveMatch: true,                 controller: 'AuthController'             })             .state('register',{                 url: '\/register',                 templateUrl: 'register.html',                 caseInsensitiveMatch: true,                 controller: 'AuthController'             }).state('unauth',{                 url: '\/unauth',                 templateUrl: 'unauth.html',                 caseInsensitiveMatch: true             });     } ]);        <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c <code>user.js<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Angular\/Models <\/p>\n<pre><code class=\"javascript\">\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c var mongoose = require('mongoose'); \/\/ \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 mongoose \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0438\u043f\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0445\u0435\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 var userSchema = new mongoose.Schema({     username: String,     password: String,     email: String,     role: String,     created_at: {type: Date, default: Date.now}      }); mongoose.model('User', userSchema); var User = mongoose.model('User'); exports.findByUsername = function(userName, callback){ User.findOne({ user_name: userName}, function(err, user){         if(err){             return callback(err);         } return callback(null, user); }); }  exports.findById = function(id, callback){ User.findById(id, function(err, user){         if(err){            return callback(err);         }          return callback(null, user);     }); } <\/code><\/pre>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0433\u043e\u0442\u043e\u0432\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u2014 <code>AuthController.js <\/code> \u0438 <code> MainController.js <\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Angular\/Controller.<\/p>\n<pre><code class=\"javascript\">\/\/ \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 auth main.controller(&quot;AuthController&quot;, function ($scope, $http, $rootScope, $location) { $scope.user = {username: '', password: ''}; $scope.error_message = ''; \/\/ \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043a webapi (\u0441\u0435\u0440\u0432\u0438\u0441, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 node) $scope.login = function(){         $http.post('\/auth\/login', $scope.user).success(function(data){         if(data.state == 'success'){                 $rootScope.authenticated = true;                 $rootScope.current_user = data.user.username;                 $rootScope.sess = data.user;                 sessionStorage.setItem('current_user', $rootScope.sess.username);                 $location.path('\/');                 }             else{                 $scope.error_message = data.message;                 $rootScope.sess = null;             }         }); };   \/\/ \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043a webapi (\u0441\u0435\u0440\u0432\u0438\u0441, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 node)     $scope.register = function(){ console.log($scope.user);         $http.post('\/auth\/signup', $scope.user).success(function(data){ if(data.state == 'success'){                 $rootScope.authenticated = true;                 $rootScope.current_user = data.user.username;                 $location.path('\/');             }             else{                 $scope.error_message = data.message;             }         });     }; }); <\/code><\/pre>\n<pre><code class=\"javascript\">\/\/\u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438  you \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 main.controller(&quot;MainController&quot;, function ($scope) {}); \/\/ \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u2013 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Views, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 ejs, \u0442\u0430\u043a \u043a\u0430\u043a ejs \u2013 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 nodejs \u0432 \u0444\u0430\u0439\u043b\u0435 Starter.ejs.<\/p>\n<pre><code class=\"html\">&lt;html ng-app=&quot;main&quot;&gt; &lt;head&gt;     &lt;meta charset=&quot;utf-8&quot; \/&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot; \/&gt;     &lt;title&gt;Super Application&lt;\/title&gt;     &lt;link href=&quot;bootstrap.css&quot; rel=&quot;stylesheet&quot; \/&gt;     &lt;link href=&quot;Site.css&quot; rel=&quot;stylesheet&quot; \/&gt;     &lt;script src=&quot;modernizr-2.6.2.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;jquery-1.10.2.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;bootstrap.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;angular.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;angular-route.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;angular-ui-router.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;angular-resource.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;\/Modules\/mainApp.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;\/Controllers\/MainController.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;\/Controllers\/AuthController.js&quot;&gt;&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt;     &lt;div class=&quot;navbar navbar-inverse navbar-fixed-top&quot;&gt;         &lt;div class=&quot;container&quot;&gt;             &lt;div class=&quot;navbar-header&quot;&gt;                 &lt;button type=&quot;button&quot; class=&quot;navbar-toggle&quot; data-toggle=&quot;collapse&quot; data-target=&quot;.navbar-collapse&quot;&gt;                     &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;                     &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;                     &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;                 &lt;\/button&gt;                 &lt;a class=&quot;navbar-brand&quot; href=&quot;#\/home&quot;&gt;Application name&lt;\/a&gt;             &lt;\/div&gt;                          &lt;div class=&quot;navbar-collapse collapse&quot;&gt;                 &lt;ul class=&quot;nav navbar-nav&quot;&gt;                     &lt;li&gt;&lt;a href=&quot;#\/home&quot;&gt;Home&lt;\/a&gt;&lt;\/li&gt;                     &lt;li&gt;&lt;a href=&quot;#\/about&quot;&gt;About&lt;\/a&gt;&lt;\/li&gt;                     &lt;li&gt;&lt;a href=&quot;#\/contact&quot;&gt;Contact&lt;\/a&gt;&lt;\/li&gt;                 &lt;\/ul&gt;                 &lt;ul class=&quot;nav navbar-nav navbar-right&quot;&gt;                     &lt;li&gt;&lt;p class=&quot;navbar-right navbar-text&quot;&gt;Signed in as {{current_user}}&lt;\/p&gt;&lt;\/li&gt;                     &lt;li&gt;&lt;p class=&quot;navbar-right navbar-text&quot; ng-hide=&quot;authenticated&quot;&gt;                         &lt;a href=&quot;#\/login&quot;&gt;Login&lt;\/a&gt; or &lt;a href=&quot;#\/register&quot;&gt;Register&lt;\/a&gt;                     &lt;\/p&gt;&lt;\/li&gt;                     &lt;li&gt;&lt;p class=&quot;navbar-right navbar-text&quot; ng-show=&quot;authenticated&quot;&gt;                         &lt;a href=&quot;#&quot; ng-click=&quot;signout()&quot;&gt;Logout&lt;\/a&gt;                     &lt;\/p&gt;&lt;\/li&gt;                 &lt;\/ul&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;container body-content&quot;&gt;         &lt;div ui-view&gt;         &lt;\/div&gt;         &lt;hr \/&gt;         &lt;footer&gt;             &lt;p&gt;My ASP.NET Application&lt;\/p&gt;         &lt;\/footer&gt;     &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Authentication \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Views; \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f, \u0432\u0445\u043e\u0434 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0442.\u0434.). <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Authentification \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c login.html.<\/p>\n<pre><code class=\"html\">&lt;form class=&quot;form-auth&quot; ng-submit=&quot;login()&quot;&gt;     &lt;h2&gt;Log In&lt;\/h2&gt;     &lt;p class=&quot;text-warning&quot;&gt;{{error_message}}&lt;\/p&gt;     &lt;input type=&quot;username&quot; ng-model=&quot;user.username&quot; placeholder=&quot;Username&quot; class=&quot;form-control&quot; required&gt;&lt;br&gt;     &lt;input type=&quot;password&quot; ng-model=&quot;user.password&quot; placeholder=&quot;Password&quot; class=&quot;form-control&quot; required&gt;&lt;br&gt;     &lt;input type=&quot;submit&quot; value=&quot;Log in&quot; class=&quot;btn btn-primary&quot; \/&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Authentification \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c register.html <\/p>\n<pre><code class=\"html\">&lt;form class=&quot;form-auth&quot; ng-submit=&quot;register()&quot;&gt;     &lt;h2&gt;Register&lt;\/h2&gt;     &lt;p class=&quot;text-warning&quot;&gt;{{error_message}}&lt;\/p&gt;     &lt;input type=&quot;email&quot; ng-model=&quot;user.email&quot; placeholder=&quot;Email&quot; class=&quot;form-control&quot; required&gt;&lt;br&gt;     &lt;input type=&quot;username&quot; ng-model=&quot;user.username&quot; placeholder=&quot;Username&quot; class=&quot;form-control&quot; required&gt;&lt;br&gt;     &lt;input type=&quot;password&quot; ng-model=&quot;user.password&quot; placeholder=&quot;Password&quot; class=&quot;form-control&quot; required&gt;&lt;br&gt;     &lt;select ng-init=&quot;user.role = roles[0].name&quot; ng-model=&quot;user.role&quot; ng-options=&quot;role.name as role.name for role in roles&quot; class=&quot;form-control&quot; required&gt;&lt;\/select&gt;&lt;br&gt;     &lt;input type=&quot;submit&quot; value=&quot;Sign Up&quot; class=&quot;btn btn-primary&quot; \/&gt; &lt;\/form&gt;  <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0435\u0433\u043e, \u0447\u0442\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Authentification \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c unauth.html <\/p>\n<pre><code class=\"html\">&lt;form class=&quot;form-auth&quot;&gt;     &lt;h2&gt;You are Authentic\/Unauthorize to access this page, This is because &lt;\/h2&gt;     &lt;p&gt;1) Not login? Please register to access resources.&lt;\/p&gt;     &lt;p&gt;2) Registered: You are not Authorize user, Please contact Administrator.&lt;\/p&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Views \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Main. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (index, about us, contact \u0438 \u0442.\u0434).<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f Index \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b index.html \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Main.<\/p>\n<pre><code class=\"html\">&lt;div&gt;     &lt;div class=&quot;jumbotron&quot;&gt;         &lt;h1&gt;Node.js Application&lt;\/h1&gt;         &lt;p class=&quot;lead&quot;&gt;Node.js is a free Javascript framework for building great Web sites and Web applications using HTML, CSS and JavaScript.&lt;\/p&gt;         &lt;p&gt;&lt;a class=&quot;btn btn-primary btn-lg&quot;&gt;Learn more &raquo;&lt;\/a&gt;&lt;\/p&gt;     &lt;\/div&gt;     &lt;div class=&quot;row&quot;&gt;         &lt;div class=&quot;col-md-4&quot;&gt;             &lt;h2&gt;Getting started&lt;\/h2&gt;             &lt;p&gt;                 ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that                 enables a clean separation of concerns and gives you full control over markup                 for enjoyable, agile development.             &lt;\/p&gt;             &lt;p&gt;&lt;a class=&quot;btn btn-default&quot; href=&quot;http:\/\/go.microsoft.com\/fwlink\/?LinkId=301865&quot;&gt;Learn more &raquo;&lt;\/a&gt;&lt;\/p&gt;         &lt;\/div&gt;         &lt;div class=&quot;col-md-4&quot;&gt;             &lt;h2&gt;Get more libraries&lt;\/h2&gt;             &lt;p&gt;NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.&lt;\/p&gt;             &lt;p&gt;&lt;a class=&quot;btn btn-default&quot; href=&quot;http:\/\/go.microsoft.com\/fwlink\/?LinkId=301866&quot;&gt;Learn more &raquo;&lt;\/a&gt;&lt;\/p&gt;         &lt;\/div&gt;         &lt;div class=&quot;col-md-4&quot;&gt;             &lt;h2&gt;Web Hosting&lt;\/h2&gt;             &lt;p&gt;You can easily find a web hosting company that offers the right mix of features and price for your applications.&lt;\/p&gt;             &lt;p&gt;&lt;a class=&quot;btn btn-default&quot; href=&quot;http:\/\/go.microsoft.com\/fwlink\/?LinkId=301867&quot;&gt;Learn more &raquo;&lt;\/a&gt;&lt;\/p&gt;         &lt;\/div&gt;     &lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f About us \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b About.html \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Main.<\/p>\n<pre><code class=\"javascript\">&lt;div&gt;     &lt;h2&gt;About Us&lt;\/h2&gt;     &lt;h3&gt;Message&lt;\/h3&gt;     &lt;p&gt;Use this area to provide additional information.&lt;\/p&gt; &lt;\/div&gt; \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u00abContact us\u00bb \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b Contact.html \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Main. &lt;div&gt;     &lt;h2&gt;Contact Us&lt;\/h2&gt;     &lt;h3&gt;Message&lt;\/h3&gt;     &lt;address&gt;         One Microsoft Way&lt;br \/&gt;         Redmond, WA 98052-6399&lt;br \/&gt;         &lt;abbr title=&quot;Phone&quot;&gt;P:&lt;\/abbr&gt;         425.555.0100     &lt;\/address&gt;     &lt;address&gt;         &lt;strong&gt;Support:&lt;\/strong&gt;   &lt;a href=&quot;mailto:Support@example.com&quot;&gt;Support@example.com&lt;\/a&gt;&lt;br \/&gt;         &lt;strong&gt;Marketing:&lt;\/strong&gt; &lt;a href=&quot;mailto:Marketing@example.com&quot;&gt;Marketing@example.com&lt;\/a&gt;     &lt;\/address&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0430 angular.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0430 node.js<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c authentication.js \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Routes.<\/p>\n<pre><code class=\"javascript\">var express = require('express'); var router = express.Router(); module.exports = function(passport){ \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (angular)     router.get('\/success',function(req,res){            res.send({state: 'success', user: req.user ? req.user: null});         }); \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435\u0443\u0434\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (angular)     router.get('\/failure',function(req,res){ res.send({state: 'failure',user:null,message:&quot;Invalid username or password&quot;});     });     \/\/ \u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 router.post('\/login',passport.authenticate('login',{         successRedirect: '\/auth\/success',         failureRedirect: '\/auth\/failure'     })); \/\/ \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435     router.post('\/signup', passport.authenticate('signup', {         successRedirect: '\/auth\/success',         failureRedirect: '\/auth\/failure'     })); \/\/ \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b     router.get('\/signout', function(req, res) {         req.session.user = null;         req.logout();         res.redirect('\/');     }); return router; } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c router.js \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.<\/p>\n<pre><code class=\"javascript\">var express = require('express'); var router = express.Router(); var mongoose = require( 'mongoose' );  router.get('\/',function(req,res,next){         res.render('Starter',{title:&quot;Super App&quot;});     });  module.exports = router; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Passport \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b (API) Name passport-init.js, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434. \u0412 \u0432\u0430\u0448\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f Authentication Api.<\/p>\n<pre><code class=\"javascript\">var mongoose = require('mongoose');    var User = mongoose.model('User'); var LocalStrategy   = require('passport-local').Strategy; var bCrypt = require('bcrypt-nodejs'); module.exports = function(passport){ \/\/ Passport \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439,\u0447\u0442\u043e\u0431\u044b \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0435 \u0441\u0435\u0430\u043d\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439     passport.serializeUser(function(user, done) {         console.log('serializing user:',user.username);         done(null, user._id);     }); passport.deserializeUser(function(id, done) {         User.findById(id, function(err, user) {             console.log('deserializing user:',user.username);             done(err, user);         });     }); passport.use('login', new LocalStrategy({             passReqToCallback : true         },         function(req, username, password, done) {          \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432 mongo, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c             User.findOne({ 'username' :  username },                  function(err, user) {                     \/\/ \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044e\u0431\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 done                      if (err)                         return done(err);                     \/\/ \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u0430\u0434                     if (!user){                         console.log('User Not Found with username '+username);                         return done(null, false);                                      }                     \/\/ \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u043e \u0432\u0432\u0435\u0434\u0435\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c. \u041b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443                      if (!isValidPassword(user, password)){                         console.log('Invalid Password');                         return done(null, false); \/\/ \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430                     }                     \/\/ \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u0435\u0440\u043d\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 done                     \/\/ \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0443\u0441\u043f\u0435\u0445                     return done(null, user);                 }             );         }     )); passport.use('signup', new LocalStrategy({             passReqToCallback : true \/\/ \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432         },         function(req, username, password, done, email, role) { \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 mongo \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c             User.findOne({ 'username' :  username }, function(err, user) {                 \/\/ \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044e\u0431\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 done                 if (err){                     console.log('Error in SignUp: '+ err);                     return done(err);                 }                 \/\/ \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442                 if (user) {                     console.log('User already exists with username: '+username);                     return done(null, false);                 } else {                     \/\/ \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u2013 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e                     var newUser = new User();                     \/\/ \u0437\u0430\u0434\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f                     newUser.username = username;                     newUser.password = createHash(password);                     newUser.email = req.body.email;                     newUser.role = req.body.role;                     \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f                     newUser.save(function(err) {                         if (err){                             console.log('Error in Saving user: '+err);                               throw err;                           }                         console.log(newUser.username + ' Registration succesful');                             return done(null, newUser);                     });                 }             });         })     ); var isValidPassword = function(user, password){         return bCrypt.compareSync(password, user.password);     };     \/\/ \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u0448 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 bCrypt     var createHash = function(password){         return bCrypt.hashSync(password, bCrypt.genSaltSync(10), null);     }; }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b server.js, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"javascript\">\/\/server.js \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438  var express = require('express'); \/\/express  var path = require('path'); \/\/ \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u043c \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b var logger = require('morgan');  var cookieParser = require('cookie-parser'); \/\/\u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 var bodyParser = require('body-parser'); \/\/\u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430 json var bcrypt = require('bcrypt-nodejs');  var passport = require('passport'); \/\/\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c passportjs \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 var LocalStrategy = require('passport-local').Strategy; \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 var session = require('express-session'); \/\/ \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 var mongoose = require('mongoose'); \/\/\u0434\u043b\u044f mongodb, \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 var models_user = require('.\/Angular\/Models\/user.js'); \/\/ \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 server.js  \/\/ \u0441\u0432\u044f\u0437\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 mongoose.connect('mongodb:\/\/localhost\/AngularizeApp');  \/\/ \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u044b var router = require('.\/Routes\/router'); var authenticate = require('.\/Routes\/authentication')(passport);  \/\/ \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f express \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f var app = express();  \/\/\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0443\u0437\u043b\u0443, \u0447\u0442\u043e My application \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0438\u0436\u043e\u043a ejs \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0434\u0432\u0438\u0436\u043a\u0430 app.set('views', path.join(__dirname, 'Views')); app.set('view engine', 'ejs');  \/\/\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0443\u0437\u043b\u0443 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e parser, logger \u0438 passport app.use(cookieParser()); app.use(logger('dev')); app.use(session({   secret: 'keyboard cat' })); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(passport.initialize()); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 app.use(passport.session()); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0430\u043d\u0441\u0430 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430  \/\/ \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0443\u0437\u043b\u0443 \u043e \u0442\u0435\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b app.use('\/', router); app.use('\/auth', authenticate); app.use(express.static(path.join(__dirname, 'scripts'))); app.use(express.static(path.join(__dirname, 'Content'))); app.use(express.static(path.join(__dirname, 'Angular'))); app.use(express.static(path.join(__dirname, 'Views\/Main'))); app.use(express.static(path.join(__dirname, 'Views\/Authentication')));  \/\/\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c auth-api \u0434\u043b\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. var initPassport = require('.\/Passport\/passport-init'); initPassport(passport);  \/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0443\u0437\u043b\u0435 var server = app.listen(3000, function () {   var host = server.address().address;   var port = server.address().port;   console.log('Example app listening at http:\/\/%s:%s', host, port); });  \/\/ \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043c\u043e\u0434\u0443\u043b\u044f  module.exports = app; <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0441 \u043a\u043e\u0434\u043e\u043c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. \u042d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b node server.js \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 MEANApp \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b cd c:\/\/MeanApp etc.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 mongodb. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e cmd \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 mongod -dbpath. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 mongodb, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0442\u043e \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 mongodb server. \u041d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u043e\u043a\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u0437\u0430\u043a\u0440\u043e\u0435\u0442\u0435, \u0442\u043e \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  <code>mongod -dbpath<br \/>  <\/code> <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ac\/c42\/294\/4acc42294ae3481bb2a596c9f596b334.PNG\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043e\u043a\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u043c mongodb \u2013 \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u0432\u0430\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f. \u041e mongodb \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 <a href=\"https:\/\/docs.mongodb.org\/manual\/?_ga=1.191144874.1680598228.1447055223\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<br \/>  <code>MeanApp&gt;node server.js<br \/>  <\/code><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6c9\/79a\/f50\/6c979af508a64dd8b1e8075012e42dc2.PNG\"\/> <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0435\u0430\u043d\u0441\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043d\u0430 github <a href=\"https:\/\/github.com\/nomiali5\/NodejsBasicAuthentication\">\u0437\u0434\u0435\u0441\u044c<\/a>.         \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0435\u043a\u0430 MEAN<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"279237\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14729\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71939\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71939\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71939\">\u0422\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430, \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u0439 \u043a\u043d\u0438\u0433\u0443<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71941\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71941\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71941\">\u041d\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0435\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/279237\/\"> https:\/\/habrahabr.ru\/post\/279237\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0441\u0442\u0435\u043a\u0435 MEAN (Mongo, Express, Angular, Node) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u043c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u043d\u043e\u0439) \u0442\u0435\u043c\u043e\u0439. \u041f\u0440\u043e\u0441\u0438\u043c \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043a\u043d\u0438\u0433\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u0442\u0435\u043a\u0435. \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-276076","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276076","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=276076"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276076\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=276076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=276076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=276076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}