add favicon

This commit is contained in:
Ondrej Synacek 2019-10-20 19:30:32 +02:00
parent 0585203dde
commit 132c6a2807
4 changed files with 29 additions and 1 deletions

View File

@ -1,6 +1,7 @@
const express = require('express') const express = require('express')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')
const path = require('path') const path = require('path')
const favicon = require('serve-favicon')
const crawl = require('./crawler') const crawl = require('./crawler')
const parseHTML = require('./parser') const parseHTML = require('./parser')
@ -12,6 +13,8 @@ const app = express()
app.set('view engine', 'ejs') app.set('view engine', 'ejs')
app.set('views', path.join(__dirname, 'views')) app.set('views', path.join(__dirname, 'views'))
app.use(favicon(path.join(__dirname, 'views', 'favicon.ico')))
app.use(bodyParser()) app.use(bodyParser())
app.get('/', (req, res) => { app.get('/', (req, res) => {

BIN
lib/views/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

24
package-lock.json generated
View File

@ -2732,6 +2732,30 @@
} }
} }
}, },
"serve-favicon": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.5.0.tgz",
"integrity": "sha1-k10kDN/g9YBTB/3+ln2IlCosvPA=",
"requires": {
"etag": "~1.8.1",
"fresh": "0.5.2",
"ms": "2.1.1",
"parseurl": "~1.3.2",
"safe-buffer": "5.1.1"
},
"dependencies": {
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
}
}
},
"serve-static": { "serve-static": {
"version": "1.14.1", "version": "1.14.1",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",

View File

@ -25,7 +25,8 @@
"ejs": "^2.7.1", "ejs": "^2.7.1",
"express": "^4.17.1", "express": "^4.17.1",
"ics": "^2.18.0", "ics": "^2.18.0",
"request": "^2.88.0" "request": "^2.88.0",
"serve-favicon": "^2.5.0"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^1.19.3" "nodemon": "^1.19.3"