{"id":430213,"date":"2024-08-25T21:00:58","date_gmt":"2024-08-25T21:00:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=430213"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=430213","title":{"rendered":"<span>Hono.js: \u041b\u0435\u0433\u043a\u0438\u0439 \u041f\u0443\u0442\u044c \u043a \u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c API<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0442\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 Express.js. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 2024 \u0433\u043e\u0434\u0443 \u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b. \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0430\u0441, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e Hono.js.<\/p>\n<p>Hono.js \u2014 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, <em>\u043f\u0440\u043e\u0441\u0442\u043e\u0439<\/em> \u0438 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u0445. \u041f\u043e\u0434 <em>\u0435\u0433\u043e<\/em> \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 TypeScript \u0438 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u0430\u044f <em>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/em> \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. Hono.js \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 <em>\u0440\u0430\u0437\u043d\u044b\u0445<\/em> \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430\u0445 JavaScript: Cloudflare <em>Workers, Deno, Bun, Vercel, Netlify,<\/em> \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 Node.js.  <\/p>\n<p>Hono.js \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u041c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Express.js \u0438\u043b\u0438 Koa.js, \u0445\u043e\u0442\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0431\u044b\u0432\u0430\u044e\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0438 \u0442\u044f\u0436\u0435\u043b\u044b\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e Hono.js \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044f \u0443\u043b\u044c\u0442\u0440\u0430\u043b\u0435\u0433\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Hono.js<\/h3>\n<h3>\u041b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>Hono.js \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u043e\u0441\u0442\u044c\u044e \u2014 \u044d\u0442\u043e <em>\u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445<\/em> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435. \u0420\u0430\u0437\u043c\u0435\u0440 <em>\u0435\u0433\u043e<\/em> \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0435\u043d, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 <em>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/em> <em>\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/em> \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043f\u0440\u0438 <em>\u0435\u0433\u043e<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 <em>\u043e\u0442<\/em> <em>\u043a\u0440\u0443\u043f\u043d\u044b\u0445<\/em> \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, Hono.js \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d <em>\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445<\/em> <em>\u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/em> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 <em>\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c<\/em> \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f Express.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0441\u0438\u0442 2 \u041c\u0411, Hono.js \u0432\u0435\u0441\u0438\u0442 <em>\u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c<\/em> 14 \u041a\u0411.<\/p>\n<h3>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>Hono.js \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u0438\u043c \u0432 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. \u041e\u043d \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u043d, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 middleware \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 URL.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Hono.js.:<\/p>\n<pre><code class=\"typescript\">import { Hono } from 'hono' const app = new Hono()  app.get('\/', (c) =&gt; c.text('Hono!'))  export default app<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Express.js, \u0432\u044b\u0439\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e:<\/p>\n<pre><code class=\"javascript\">const express = require('express')  const app = express()  const port = 3000  app.get('\/', (req, res) =&gt; {    res.send('Hello World!')  })  app.listen(port, () =&gt; {    console.log(Example app listening on port ${port})  }) <\/code><\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f Hono.js, \u043d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451, \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <abbr class=\"habraabbr\" title=\"\u0411\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0434\u0440.\" data-title=\"&lt;p&gt; \u0411\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0434\u0440.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;\" data-abbr=\"Bun.js\">Bun.js<\/abbr> .<\/p>\n<hr\/>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430  <\/h3>\n<h4>1)  \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h4>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <abbr class=\"habraabbr\" title=\"\u041d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.\" data-title=\"&lt;p&gt;\u041d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.&lt;\/p&gt;\" data-abbr=\"Bun\">Bun<\/abbr> \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">bun init<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a <code>Hono.js<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 Bun \u0432 index.tsx:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx Bun.serve({ fetch: (req) =&gt; { return new Response('Hello from Bun!') }, port: process.env.PORT || 3030 })<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8c5\/669\/7f9\/8c56697f9089d3f06137a436ba8a2c84.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 3030-\u043e\u043c \u043f\u043e\u0440\u0442\u0443\" title=\"\u0412\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 3030-\u043e\u043c \u043f\u043e\u0440\u0442\u0443\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8c5\/669\/7f9\/8c56697f9089d3f06137a436ba8a2c84.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 3030-\u043e\u043c \u043f\u043e\u0440\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<h4>2)  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Hono.js<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c <code>Hono.js<\/code> :<\/p>\n<pre><code class=\"bash\">bun i hono <\/code><\/pre>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c <code>Hono<\/code> \u0438 \u043f\u0438\u0448\u0435\u043c GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e JSON, \u0447\u0443\u0442\u043a\u0430 \u043c\u0435\u043d\u044f\u044f \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 Bun:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import { Hono } from 'hono'  const app = new Hono()  app.get('\/hello', (c) =&gt; { return c.json({ hello: 'world' }) })  Bun.serve({ fetch: app.fetch, port: process.env.PORT || 3030, }) <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, <em>\u043c\u044b<\/em> \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u044d\u0442\u043e <em>\u0432\u0441\u0451<\/em> Hono. \u0422\u0435\u043f\u0435\u0440\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 Bun, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439, \u0447\u0442\u043e <em>\u043d\u0430\u043c<\/em> \u0434\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e <em>\u0443\u0434\u043e\u0431\u043d\u043e\u0435<\/em> API:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3e3\/aeb\/82a\/3e3aeb82a4e3d4f41eed60ed168c9a9d.png\" alt=\"\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443\" title=\"\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e3\/aeb\/82a\/3e3aeb82a4e3d4f41eed60ed168c9a9d.png\"\/><\/p>\n<div><figcaption>\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<h3>3)  \u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f Hono.js<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044f \u043f\u043e \u043e\u0444\u0438\u0446. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <code>Hono.js<\/code> , <em>\u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c<\/em> \u0440\u0430\u0437\u0434\u0435\u043b \u043e\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Hono \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <em>\u0438\u0445<\/em> \u0432 <em>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>route<\/code>.\u00a0  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>books.ts<\/code> \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0442\u0442\u0443\u0434\u0430. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>book<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"typescript\">\/\/ routes\/books.ts import { Hono } from 'hono'  const book = new Hono()  book.get('\/', (c) =&gt; c.text('List Books')) \/\/ GET \/book book.get('\/:id', (c) =&gt; {   \/\/ GET \/book\/:id   const id = c.req.param('id')   return c.text('Get Book: ' + id) }) book.post('\/', (c) =&gt; c.text('Create Book')) \/\/ POST \/book  const app = new Hono() app.route('\/book', book)  export default book<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c bookRouter \u0438\u0437 book.ts \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.  \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u0438\u0433:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx app.route('\/book', bookRouter)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/21b\/fae\/f89\/21bfaef897d2745cf8be2522bfa442d8.png\" alt=\"&quot;\u0421\u043f\u0438\u0441\u043e\u043a&quot; \u043a\u043d\u0438\u0436\u0435\u043a \u043d\u0430 \/book\" title=\"&quot;\u0421\u043f\u0438\u0441\u043e\u043a&quot; \u043a\u043d\u0438\u0436\u0435\u043a \u043d\u0430 \/book\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21b\/fae\/f89\/21bfaef897d2745cf8be2522bfa442d8.png\"\/><\/p>\n<div><figcaption>&#171;\u0421\u043f\u0438\u0441\u043e\u043a&#187; \u043a\u043d\u0438\u0436\u0435\u043a \u043d\u0430 \/book<\/figcaption><\/div>\n<\/figure>\n<h4>4) \u0427\u0442\u043e \u0436\u0435 \u0437\u0430 &#171;c&#187; \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445???<\/h4>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u043c\u0435\u0441\u0442\u043e <code>req<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>c<\/code> , \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>context<\/code> . \u041e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <code>Hono.js<\/code> .<\/p>\n<p>\u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. <code>Hono<\/code> \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 json-\u0444\u043e\u0440\u043c\u0430\u0442, \u043d\u043e \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0445 <em>(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, html-\u0444\u043e\u0440\u043c\u0430\u0442).<\/em><\/p>\n<h4>5) Middleware<\/h4>\n<p>Middleware \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\/\u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e \u0434\u0438\u0441\u043f\u0430\u0442\u0447\u0430 \u0438\u043b\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0434\u0438\u0441\u043f\u0430\u0442\u0447\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import { logger } from 'hono\/logger'  app.use('*', logger())<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 VS Code \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0f9\/250\/207\/0f9250207779e7a701ca92e5d383b848.png\" alt=\"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430\" title=\"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0f9\/250\/207\/0f9250207779e7a701ca92e5d383b848.png\"\/><\/p>\n<div><figcaption>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<h4>5) \u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 JSX<\/h4>\n<p>\u0425\u043e\u0442\u044f <code>hono\/jsx<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u043e JSX \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441 \u043d\u0435\u0439 \u043e\u0442\u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ page.tsx  import { Hono } from 'hono' import type { FC } from 'hono\/jsx'  const app = new Hono()  const Layout: FC = (props) =&gt; {   return (     &lt;html&gt;       &lt;body&gt;{props.children}&lt;\/body&gt;     &lt;\/html&gt;   ) }  const Top: FC&lt;{ messages: string[] }&gt; = (props: {   messages: string[] }) =&gt; {   return (     &lt;Layout&gt;       &lt;h1&gt;Hello Hono!&lt;\/h1&gt;       &lt;ul&gt;         {props.messages.map((message) =&gt; {           return &lt;li&gt;{message}!!&lt;\/li&gt;         })}       &lt;\/ul&gt;     &lt;\/Layout&gt;   ) }  export default Top<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 TypeScript \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0447\u0442\u043e\u0431\u044b JSX \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b:<\/p>\n<pre><code class=\"json\">\/\/ tsconfig.json {   \"compilerOptions\": {     \"jsx\": \"react-jsx\",     \"jsxImportSource\": \"hono\/jsx\", }<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Top \/&gt;<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u0440\u0435\u043d\u0434\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import Top  from '.\/page.tsx'   app.get('\/', (c) =&gt; {   const messages = ['Good Morning', 'Good Evening', 'Good Night']   return c.html(&lt;Top messages={messages} \/&gt;) }) <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5fe\/e49\/771\/5fee497714c7232321c6d1cca0e7a8fd.png\" alt=\"\u0420\u0435\u043d\u0434\u0435\u0440 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430\" title=\"\u0420\u0435\u043d\u0434\u0435\u0440 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5fe\/e49\/771\/5fee497714c7232321c6d1cca0e7a8fd.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u043d\u0434\u0435\u0440 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u042d\u0442\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 SSR \u0432 Next.js \u0438\u043b\u0438 Remix.js, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u0438\u043c. Hono \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0438\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, Suspense \u0438 \u0442\u0434.<\/p>\n<h4>6) \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Hono \u2014 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u0421\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0432\u044b\u043d\u0435\u0441\u0443 \u043a\u043e\u0434 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>app.tsx<\/code> . <\/p>\n<pre><code class=\"typescript\">\/\/ index.test.ts import { expect, test, describe } from 'bun:test' import app from '.\/app'   describe('Example', () =&gt; { test('GET \/posts', async () =&gt; { const res = await app.request('\/hello') expect(res.status).toBe(200) expect(await res.json()).toEqual({ hello: 'world' }) }) expect(2 + 2).toBe(4) })<\/code><\/pre>\n<pre><code class=\"typescript\">\/\/ index.tsx import app from '.\/app'  Bun.serve({ fetch: app.fetch, port: process.env.PORT || 3030, }) <\/code><\/pre>\n<p>\u0412 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u043e\u0448\u043b\u0438 \u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0438\u043b\u0438 \u043d\u0435\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b61\/d83\/2ca\/b61d832ca33b3cb0aa3b5d42c17505c8.png\" alt=\"\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b!\" title=\"\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b!\" width=\"1920\" height=\"1440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b61\/d83\/2ca\/b61d832ca33b3cb0aa3b5d42c17505c8.png\"\/><\/p>\n<div><figcaption>\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b!<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0451 API.<\/p>\n<hr\/>\n<p>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e Hono.js, \u0441\u0442\u0430\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443, \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d \u0432 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u0443\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u043d\u0430\u0434 Express.js.<\/p>\n<p>\u0412 Hono.js \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e: \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f, RPC, Best Practies \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u0414\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e!<\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0430\u0439\u0442 Hono,js \u2014 https:\/\/hono.dev<\/p>\n<\/li>\n<\/ul>\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\/838448\/\"> https:\/\/habr.com\/ru\/articles\/838448\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0442\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 Express.js. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 2024 \u0433\u043e\u0434\u0443 \u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b. \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0430\u0441, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e Hono.js.<\/p>\n<p>Hono.js \u2014 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, <em>\u043f\u0440\u043e\u0441\u0442\u043e\u0439<\/em> \u0438 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u0445. \u041f\u043e\u0434 <em>\u0435\u0433\u043e<\/em> \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 TypeScript \u0438 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u0430\u044f <em>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/em> \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. Hono.js \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 <em>\u0440\u0430\u0437\u043d\u044b\u0445<\/em> \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430\u0445 JavaScript: Cloudflare <em>Workers, Deno, Bun, Vercel, Netlify,<\/em> \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 Node.js.  <\/p>\n<p>Hono.js \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u041c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Express.js \u0438\u043b\u0438 Koa.js, \u0445\u043e\u0442\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0431\u044b\u0432\u0430\u044e\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0438 \u0442\u044f\u0436\u0435\u043b\u044b\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e Hono.js \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044f \u0443\u043b\u044c\u0442\u0440\u0430\u043b\u0435\u0433\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Hono.js<\/h3>\n<h3>\u041b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>Hono.js \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u043e\u0441\u0442\u044c\u044e \u2014 \u044d\u0442\u043e <em>\u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445<\/em> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435. \u0420\u0430\u0437\u043c\u0435\u0440 <em>\u0435\u0433\u043e<\/em> \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0435\u043d, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 <em>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/em> <em>\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/em> \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043f\u0440\u0438 <em>\u0435\u0433\u043e<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 <em>\u043e\u0442<\/em> <em>\u043a\u0440\u0443\u043f\u043d\u044b\u0445<\/em> \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, Hono.js \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d <em>\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445<\/em> <em>\u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/em> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 <em>\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c<\/em> \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f Express.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0441\u0438\u0442 2 \u041c\u0411, Hono.js \u0432\u0435\u0441\u0438\u0442 <em>\u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c<\/em> 14 \u041a\u0411.<\/p>\n<h3>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>Hono.js \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u0438\u043c \u0432 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. \u041e\u043d \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u043d, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 middleware \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 URL.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Hono.js.:<\/p>\n<pre><code class=\"typescript\">import { Hono } from 'hono' const app = new Hono()  app.get('\/', (c) =&gt; c.text('Hono!'))  export default app<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Express.js, \u0432\u044b\u0439\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e:<\/p>\n<pre><code class=\"javascript\">const express = require('express')  const app = express()  const port = 3000  app.get('\/', (req, res) =&gt; {    res.send('Hello World!')  })  app.listen(port, () =&gt; {    console.log(Example app listening on port ${port})  }) <\/code><\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f Hono.js, \u043d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451, \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <abbr class=\"habraabbr\" title=\"\u0411\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0434\u0440.\" data-title=\"&lt;p&gt; \u0411\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0434\u0440.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;\" data-abbr=\"Bun.js\">\u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0434\u0440.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;&#187; data-abbr=&#187;Bun.js&#187;>Bun.js<\/abbr> .<\/p>\n<hr\/>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430  <\/h3>\n<h4>1)  \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h4>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <abbr class=\"habraabbr\" title=\"\u041d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.\" data-title=\"&lt;p&gt;\u041d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 JavaScript-\u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.&lt;\/p&gt;\" data-abbr=\"Bun\">\u0439\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.&lt;\/p&gt;&#187; data-abbr=&#187;Bun&#187;>Bun<\/abbr> \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">bun init<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a <code>Hono.js<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 Bun \u0432 index.tsx:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx Bun.serve({ fetch: (req) =&gt; { return new Response('Hello from Bun!') }, port: process.env.PORT || 3030 })<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 3030-\u043e\u043c \u043f\u043e\u0440\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<h4>2)  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Hono.js<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c <code>Hono.js<\/code> :<\/p>\n<pre><code class=\"bash\">bun i hono <\/code><\/pre>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c <code>Hono<\/code> \u0438 \u043f\u0438\u0448\u0435\u043c GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e JSON, \u0447\u0443\u0442\u043a\u0430 \u043c\u0435\u043d\u044f\u044f \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 Bun:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import { Hono } from 'hono'  const app = new Hono()  app.get('\/hello', (c) =&gt; { return c.json({ hello: 'world' }) })  Bun.serve({ fetch: app.fetch, port: process.env.PORT || 3030, }) <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, <em>\u043c\u044b<\/em> \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u044d\u0442\u043e <em>\u0432\u0441\u0451<\/em> Hono. \u0422\u0435\u043f\u0435\u0440\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 Bun, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439, \u0447\u0442\u043e <em>\u043d\u0430\u043c<\/em> \u0434\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e <em>\u0443\u0434\u043e\u0431\u043d\u043e\u0435<\/em> API:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<h3>3)  \u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f Hono.js<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044f \u043f\u043e \u043e\u0444\u0438\u0446. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <code>Hono.js<\/code> , <em>\u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c<\/em> \u0440\u0430\u0437\u0434\u0435\u043b \u043e\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Hono \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <em>\u0438\u0445<\/em> \u0432 <em>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>route<\/code>.\u00a0  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>books.ts<\/code> \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0442\u0442\u0443\u0434\u0430. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>book<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"typescript\">\/\/ routes\/books.ts import { Hono } from 'hono'  const book = new Hono()  book.get('\/', (c) =&gt; c.text('List Books')) \/\/ GET \/book book.get('\/:id', (c) =&gt; {   \/\/ GET \/book\/:id   const id = c.req.param('id')   return c.text('Get Book: ' + id) }) book.post('\/', (c) =&gt; c.text('Create Book')) \/\/ POST \/book  const app = new Hono() app.route('\/book', book)  export default book<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c bookRouter \u0438\u0437 book.ts \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.  \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043d\u0438\u0433:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx app.route('\/book', bookRouter)<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>&#171;\u0421\u043f\u0438\u0441\u043e\u043a&#187; \u043a\u043d\u0438\u0436\u0435\u043a \u043d\u0430 \/book<\/figcaption><\/div>\n<\/figure>\n<h4>4) \u0427\u0442\u043e \u0436\u0435 \u0437\u0430 &#171;c&#187; \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445???<\/h4>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u043c\u0435\u0441\u0442\u043e <code>req<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>c<\/code> , \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>context<\/code> . \u041e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <code>Hono.js<\/code> .<\/p>\n<p>\u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. <code>Hono<\/code> \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 json-\u0444\u043e\u0440\u043c\u0430\u0442, \u043d\u043e \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0445 <em>(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, html-\u0444\u043e\u0440\u043c\u0430\u0442).<\/em><\/p>\n<h4>5) Middleware<\/h4>\n<p>Middleware \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\/\u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e \u0434\u0438\u0441\u043f\u0430\u0442\u0447\u0430 \u0438\u043b\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0434\u0438\u0441\u043f\u0430\u0442\u0447\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import { logger } from 'hono\/logger'  app.use('*', logger())<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 VS Code \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u043a\u043e\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<h4>5) \u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 JSX<\/h4>\n<p>\u0425\u043e\u0442\u044f <code>hono\/jsx<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u043e JSX \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441 \u043d\u0435\u0439 \u043e\u0442\u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ page.tsx  import { Hono } from 'hono' import type { FC } from 'hono\/jsx'  const app = new Hono()  const Layout: FC = (props) =&gt; {   return (     &lt;html&gt;       &lt;body&gt;{props.children}&lt;\/body&gt;     &lt;\/html&gt;   ) }  const Top: FC&lt;{ messages: string[] }&gt; = (props: {   messages: string[] }) =&gt; {   return (     &lt;Layout&gt;       &lt;h1&gt;Hello Hono!&lt;\/h1&gt;       &lt;ul&gt;         {props.messages.map((message) =&gt; {           return &lt;li&gt;{message}!!&lt;\/li&gt;         })}       &lt;\/ul&gt;     &lt;\/Layout&gt;   ) }  export default Top<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 TypeScript \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0447\u0442\u043e\u0431\u044b JSX \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b:<\/p>\n<pre><code class=\"json\">\/\/ tsconfig.json {   \"compilerOptions\": {     \"jsx\": \"react-jsx\",     \"jsxImportSource\": \"hono\/jsx\", }<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Top \/&gt;<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u0440\u0435\u043d\u0434\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:<\/p>\n<pre><code class=\"typescript\">\/\/ index.tsx import Top  from '.\/page.tsx'   app.get('\/', (c) =&gt; {   const messages = ['Good Morning', 'Good Evening', 'Good Night']   return c.html(&lt;Top messages={messages} \/&gt;) }) <\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u043d\u0434\u0435\u0440 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u042d\u0442\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 SSR \u0432 Next.js \u0438\u043b\u0438 Remix.js, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u0438\u043c. Hono \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0438\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, Suspense \u0438 \u0442\u0434.<\/p>\n<h4>6) \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Hono \u2014 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u0421\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0432\u044b\u043d\u0435\u0441\u0443 \u043a\u043e\u0434 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>app.tsx<\/code> . <\/p>\n<pre><code class=\"typescript\">\/\/ index.test.ts import { expect, test, describe } from 'bun:test' import app from '.\/app'   describe('Example', () =&gt; { test('GET \/posts', async () =&gt; { const res = await app.request('\/hello') expect(res.status).toBe(200) expect(await res.json()).toEqual({ hello: 'world' }) }) expect(2 + 2).toBe(4) })<\/code><\/pre>\n<pre><code class=\"typescript\">\/\/ index.tsx import app from '.\/app'  Bun.serve({ fetch: app.fetch, port: process.env.PORT || 3030, }) <\/code><\/pre>\n<p>\u0412 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u043e\u0448\u043b\u0438 \u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0438\u043b\u0438 \u043d\u0435\u0442:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b!<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0451 API.<\/p>\n<hr\/>\n<p>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e Hono.js, \u0441\u0442\u0430\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443, \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d \u0432 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u0443\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u043d\u0430\u0434 Express.js.<\/p>\n<p>\u0412 Hono.js \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e: \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f, RPC, Best Practies \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u0414\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e!<\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0430\u0439\u0442 Hono,js \u2014 https:\/\/hono.dev<\/p>\n<\/li>\n<\/ul>\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\/838448\/\"> https:\/\/habr.com\/ru\/articles\/838448\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-430213","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/430213","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=430213"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/430213\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}