mirror of
https://github.com/FranP-code/open-react-blog-api.git
synced 2025-10-12 23:52:57 +00:00
Favicon added
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"firebase-admin": "^10.2.0",
|
"firebase-admin": "^10.2.0",
|
||||||
"nodemon": "^2.0.16",
|
"nodemon": "^2.0.16",
|
||||||
"path": "^0.12.7"
|
"path": "^0.12.7",
|
||||||
|
"serve-favicon": "^2.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
public/images/favicon.ico
Normal file
BIN
public/images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
@@ -1,3 +1,4 @@
|
|||||||
|
//.env File config
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
@@ -5,11 +6,17 @@ const server = express()
|
|||||||
|
|
||||||
const port = process.env.PORT || 3000
|
const port = process.env.PORT || 3000
|
||||||
|
|
||||||
|
//Accept with JSON files
|
||||||
server.use(express.json())
|
server.use(express.json())
|
||||||
|
|
||||||
|
//Serve public for CSS files
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
server.use(express.static(path.resolve('public')));
|
server.use(express.static(path.resolve('public')));
|
||||||
|
|
||||||
|
//Define favicon
|
||||||
|
const favicon = require('serve-favicon');
|
||||||
|
server.use(favicon(path.resolve('public/images/favicon.ico')));
|
||||||
|
|
||||||
const index = require('./routes/index.js')
|
const index = require('./routes/index.js')
|
||||||
server.use("/", index)
|
server.use("/", index)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user