Skip to content

Commit 4930096

Browse files
committed
Favicon added
1 parent 5ffc3a3 commit 4930096

File tree

10 files changed

+283
-59
lines changed

10 files changed

+283
-59
lines changed

package-lock.json

Lines changed: 270 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@types/fs-extra": "^9.0.13",
2525
"@types/mongoose": "^5.11.97",
2626
"@types/morgan": "^1.9.3",
27+
"@types/serve-favicon": "^2.5.3",
2728
"cors": "^2.8.5",
2829
"express": "^4.17.3",
2930
"express-handlebars": "^6.0.5",
@@ -32,6 +33,8 @@
3233
"morgan": "^1.10.0",
3334
"multer": "^1.4.4",
3435
"rimraf": "^3.0.2",
36+
"serve-favicon": "^2.5.0",
37+
"ts-node": "^10.7.0",
3538
"uuid": "^8.3.2"
3639
},
3740
"devDependencies": {
@@ -44,4 +47,4 @@
4447
"ts-node-dev": "^1.1.8",
4548
"typescript": "^4.6.3"
4649
}
47-
}
50+
}

src/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import path from 'path';
77
import { engine } from 'express-handlebars';
88

99

10+
var favicon = require('serve-favicon');
11+
12+
1013
let app = express();
1114

1215
let port = 8000;
@@ -39,6 +42,10 @@ app.use(express.static(path.join(__dirname, 'public')));
3942
//------ Path to folder upload to storage Images
4043
app.use('/uploads',express.static(path.resolve()));
4144

45+
//------Favicon
46+
47+
app.use(favicon(__dirname + '/public/assets/favicon.ico'));
48+
4249

4350
app.use(cors());
4451
app.use(morgan('dev'));

src/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import mongoose, { connect } from "mongoose";
22

33
async function startConnection(){
44
try {
5-
await connect('mongodb://localhost/ImageApi');
5+
await connect('mongodb://localhost:27017/ImageApi');
66
console.log('\t\t Connection Successfull to Db \n');
77
}
88
catch (err) {

src/public/assets/favicon.ico

16.6 KB
Binary file not shown.

src/views/layouts/main.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="icon" href="assets/favicon.ico">
78
<link rel="stylesheet" href="Css/style.css">
89
<title>{{ title }}</title>
910
</head>
1.03 MB
Loading
1.03 MB
Loading
1.03 MB
Loading
1.03 MB
Loading

0 commit comments

Comments
 (0)