如何解决这个错误? (http:// localhost:3000 / favicon.ico 404(未找到))

时间:2018-02-11 16:18:13

标签: javascript json node.js express passport.js

如何解决这个问题?

  

http://localhost:3000/favicon.ico 404(未找到)

服务器出现此错误消息:

  

未找到404错误:未找到       在D:\ nodetour \ app.js:82:13       在Layer.handle [as handle_request](D:\ nodetour \ node_modules \ express \ lib \ router \ layer.js:95:5)       在trim_prefix(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:317:13)       在D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:284:7       在Function.process_params(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:335:12)       在下一个(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:275:10)       在D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:635:15       在下一个(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:260:14)       在Function.handle(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:174:3)       在路由器(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:47:12)       在Layer.handle [as handle_request](D:\ nodetour \ node_modules \ express \ lib \ router \ layer.js:95:5)       在trim_prefix(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:317:13)       在D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:284:7       在Function.process_params(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:335:12)       在下一个(D:\ nodetour \ node_modules \ express \ lib \ router \ index.js:275:10)       在D:\ nodetour \ app.js:74:3

1 个答案:

答案 0 :(得分:2)

您可以使用此模块为express应用程序提供favicon.ico

https://github.com/expressjs/serve-favicon