1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-07 06:25:21 +02:00

Added default favicon path, if favicon does not exists in config

This commit is contained in:
slaveeks 2022-07-07 15:59:19 +03:00
parent 30d475ed33
commit 50ebce3d15
2 changed files with 7 additions and 3 deletions

View file

@ -9,7 +9,7 @@ import * as dotenv from 'dotenv';
import config from 'config';
import os from 'os';
import appConfig from 'config';
import { downloadFavicon } from './utils/downloadFavicon';
import { downloadFavicon, FaviconData } from './utils/downloadFavicon';
dotenv.config();
const app = express();
@ -38,7 +38,11 @@ if (favicon) {
console.log('Favicon has not uploaded');
});
} else {
console.log('Favicon is empty');
console.log('Favicon is empty, using default path');
app.locals.favicon = {
destination: '/favicon.png',
type: 'image/png',
} as FaviconData;
}
app.use(morgan('dev'));

View file

@ -5,7 +5,7 @@ import fetch from 'node-fetch';
/**
* Uploaded favicon data
*/
interface FaviconData {
export interface FaviconData {
// Uploaded favicon path
destination: string;