Skip to content

Commit

Permalink
docs: adjust middleware note (#5895)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMe-A-Name committed Jul 1, 2024
1 parent 35e119a commit f3fc671
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ title: Middleware
Used to extend the built-in Web Server of Modern.js, unlike [Hook](/apis/app/runtime/web-server/hook), Middleware can directly operate Node's origin request and response, and can be extended using the framework plugin.

:::note

In the next major release, Modern.js will use new middleware to replace this approach.

It is recommended to use [UnstableMiddleware](/apis/app/runtime/web-server/unstable_middleware) to handle page requests.

:::

:::note

For more detail, see [Extend Web Server](/guides/advanced-features/web-server).

:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ title: Middleware
用于拓展 Modern.js 内置的 Web Server,与 [Hook](/apis/app/runtime/web-server/hook) 不同的是,Middleware 可以直接操作 Node 原生的请求、响应对象,并且可以使用框架拓展。

:::note

在下一个大版本,Modern.js 将会使用新 Middleware 来替代该写法。

推荐使用 [UnstableMiddleware](/apis/app/runtime/web-server/unstable_middleware) 处理页面请求。

:::

:::note

更多内容可以查看[自定义 Web Server](/guides/advanced-features/web-server)

:::

## 使用姿势
Expand Down

0 comments on commit f3fc671

Please sign in to comment.