Browse Source

chore: updates README.md

e22m4u 1 year ago
parent
commit
034d5cba4f
2 changed files with 8 additions and 8 deletions
  1. 5 5
      README-ru.md
  2. 3 3
      README.md

+ 5 - 5
README-ru.md

@@ -146,9 +146,9 @@ router.defineRoute({
 router.defineRoute({ // регистрация маршрута
 router.defineRoute({ // регистрация маршрута
   // ...
   // ...
   preHandler(ctx) {
   preHandler(ctx) {
-    // вызов перед обработчиком
+    // перед обработчиком маршрута
     console.log(`Incoming request ${ctx.method} ${ctx.path}`);
     console.log(`Incoming request ${ctx.method} ${ctx.path}`);
-    // Incoming request GET /myPath
+    // > incoming request GET /myPath
   },
   },
   handler(ctx) {
   handler(ctx) {
     return 'Hello world!';
     return 'Hello world!';
@@ -189,7 +189,7 @@ router.defineRoute({
     return 'Hello world!';
     return 'Hello world!';
   },
   },
   postHandler(ctx, data) {
   postHandler(ctx, data) {
-    // вызов после обработчика маршрута
+    // после обработчика маршрута
     return data.toUpperCase(); // HELLO WORLD!
     return data.toUpperCase(); // HELLO WORLD!
   },
   },
 });
 });
@@ -209,11 +209,11 @@ router.defineRoute({
 
 
 ```js
 ```js
 router.addHook('preHandler', (ctx) => {
 router.addHook('preHandler', (ctx) => {
-  // вызов перед обработчиком маршрута
+  // перед обработчиком маршрута
 });
 });
 
 
 router.addHook('postHandler', (ctx, data) => {
 router.addHook('postHandler', (ctx, data) => {
-  // вызов после обработчика маршрута
+  // после обработчика маршрута
 });
 });
 ```
 ```
 
 

+ 3 - 3
README.md

@@ -147,9 +147,9 @@ hook.
 router.defineRoute({ // register a route
 router.defineRoute({ // register a route
   // ...
   // ...
   preHandler(ctx) {
   preHandler(ctx) {
-    // called before the route handler
-    console.log(`Incoming request ${ctx.method} ${ctx.path}`);
-    // Incoming request GET /myPath
+    // before the route handler
+    console.log(`incoming request ${ctx.method} ${ctx.path}`);
+    // > incoming request GET /myPath
   },
   },
   handler(ctx) {
   handler(ctx) {
     return 'Hello world!';
     return 'Hello world!';