Thursday, 13 April 2017

Favicon not showing locally on express

Am I missing something? Here is what I have:

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'))); 

app.use('/api', require('./routes/api'));

app.listen(3000);

My favicon is located as specified in the public folder and the same name. I have some other routes setup separately in a file. The favicon doesn't appear to be working, I must be missing something.



via Babagana Zannah

No comments:

Post a Comment