awesomeunicorn 1308
awesomeunicorn 1308

Reputation: 13

most middleware (like favicon) is no longer bundled with express and must be installed separately

I have tried to solve it by installing serve favicon to my app direction like (C:\Users\I am\Backup\Work node install serve-favicon)and got the same mistake.enter image description here

Upvotes: 0

Views: 3824

Answers (1)

rsp
rsp

Reputation: 111414

You didn't include any source code so it's hard to guess how it looks like. In order to use the serve-favicon module you need to install it with:

npm install serve-favicon --save

and use it in your app with something like this:

var express = require('express');
var favicon = require('serve-favicon');
var path = require('path');

var app = express();
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));

See the docs:

Upvotes: 2

Related Questions