如何在slc loopback生成的webapp中替换默认的favicon? [英] How can I replace the default favicon in an slc loopback generated webapp?
问题描述
我已经使用slc loopback命令生成了一个应用程序。所以生成的快递webapp有其强大的图标。我如何更改图标?
I have generated an app using slc loopback command. So the generated express webapp has its strongloop favicon. How can I change the favicon?
我在server.js中使用这个
I am using this in server.js
app.use(loopback.favicon(path.resolve(__dirname, '../client/favicon.ico')));
我还尝试使用html链接标记,但仍默认正在加载。
I also tried with html link tag, but still default is loading.
我做错了什么?
推荐答案
在<$中设置自定义favicon的路径c $ c> server / middleware.json :
{
"initial:before": {
"loopback#favicon": {
"params": "path/to/your/favicon.ico"
}
},
…
我们在HTML中设置路径时遇到问题,有些重新加载默认的StrongLoop favicon仍然弹出。此配置有助于。
We had problems setting the paths just in the HTML, on some reloads the default StrongLoop favicon was still popping up. This configuration helped.
PS:如果您的favicon.ico位于客户端目录的根目录,请使用以下路径:$! /client/favicon.ico
PS: If your favicon.ico is in the root of the client directory, use this path: "$!../client/favicon.ico"
这篇关于如何在slc loopback生成的webapp中替换默认的favicon?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!