mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-10 07:55:24 +02:00
Added default favicon path, if favicon does not exists in config
This commit is contained in:
parent
30d475ed33
commit
50ebce3d15
2 changed files with 7 additions and 3 deletions
|
@ -9,7 +9,7 @@ import * as dotenv from 'dotenv';
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import appConfig from 'config';
|
import appConfig from 'config';
|
||||||
import { downloadFavicon } from './utils/downloadFavicon';
|
import { downloadFavicon, FaviconData } from './utils/downloadFavicon';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
const app = express();
|
const app = express();
|
||||||
|
@ -38,7 +38,11 @@ if (favicon) {
|
||||||
console.log('Favicon has not uploaded');
|
console.log('Favicon has not uploaded');
|
||||||
});
|
});
|
||||||
} else {
|
} 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'));
|
app.use(morgan('dev'));
|
||||||
|
|
|
@ -5,7 +5,7 @@ import fetch from 'node-fetch';
|
||||||
/**
|
/**
|
||||||
* Uploaded favicon data
|
* Uploaded favicon data
|
||||||
*/
|
*/
|
||||||
interface FaviconData {
|
export interface FaviconData {
|
||||||
// Uploaded favicon path
|
// Uploaded favicon path
|
||||||
destination: string;
|
destination: string;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue