Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

突然发现 favicon.ico 会自动加载成路由,而不是图标 #57

Closed
dehyang opened this issue Aug 20, 2021 · 3 comments
Closed

Comments

@dehyang
Copy link

dehyang commented Aug 20, 2021

image

开始还奇怪每次都是执行2次,结果发现 /favicon.ico 被当成了页面请求,大佬,有没有什么办法处理?

@lzxb
Copy link
Contributor

lzxb commented Aug 20, 2021

这个不是Genesis的问题,是你写的express服务器没有处理这个路由,而是把所有的路由都转入到 SSR中间件中,

@lzxb
Copy link
Contributor

lzxb commented Aug 20, 2021

可以了解一下这个库:https://www.npmjs.com/package/serve-favicon

@lzxb lzxb closed this as completed Aug 20, 2021
@dehyang
Copy link
Author

dehyang commented Aug 20, 2021

可以了解一下这个库:https://www.npmjs.com/package/serve-favicon

OK,引入解决了。 这次我才彻底明白了中间件!!。。有时只看理论只是模糊,真到了实际应用才有一种豁然开朗的感觉。。谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants