diff --git a/source/api/filter.md b/source/api/filter.md index acd44c6a1c..64f5be22b6 100644 --- a/source/api/filter.md +++ b/source/api/filter.md @@ -212,15 +212,8 @@ hexo.extend.filter.register("after_clean", function () { Add middleware to the server. `app` is a [Connect] instance. -For example, to add `X-Powered-By: Hexo` to the response header: - -```js -hexo.extend.filter.register("server_middleware", function (app) { - app.use(function (req, res, next) { - res.setHeader("X-Powered-By", "Hexo"); - next(); - }); -}); -``` +This hook is provided by [hexo-server], not Hexo core, so it only runs when `hexo-server` is installed. See the [hexo-server README] for an implementation example. [Connect]: https://github.com/senchalabs/connect +[hexo-server]: https://github.com/hexojs/hexo-server +[hexo-server README]: https://github.com/hexojs/hexo-server#middleware