Commit 85814510 authored by A. Koch's avatar A. Koch

add favicon, logger updates

parent 3a30a3c9
......@@ -2866,6 +2866,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": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
......
......@@ -4,9 +4,9 @@
"description": "A minimalist version of the Motion Bank API",
"main": "src/index.js",
"scripts": {
"start": "node src",
"lint": "eslint src/. --config .eslintrc.js",
"metapak": "metapak",
"start": "node src",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Mainz University of Applied Sciences (Motion Bank Project)",
......@@ -45,6 +45,7 @@
"nedb": "^1.8.0",
"polka": "^0.4.0",
"primus": "^7.2.2",
"serve-favicon": "^2.5.0",
"serve-static": "^1.13.2",
"tiny-emitter": "^2.0.2",
"uws": "^10.148.0",
......
const
config = require('config'),
path = require('path'),
http = require('http'),
polka = require('polka'),
Primus = require('primus'),
......@@ -7,6 +8,7 @@ const
cors = require('cors')({ origin: true }),
send = require('@polka/send-type'),
jwt = require('express-jwt'),
favicon = require('serve-favicon'),
jwks = require('jwks-rsa'),
{ json } = require('body-parser'),
{ ObjectUtil } = require('mbjs-utils')
......@@ -51,6 +53,8 @@ const setup = async function () {
}
})
app.use(favicon(path.join(__dirname, '..', 'assets', 'favicon.ico')))
const jwtCheck = jwt(ObjectUtil.merge({
secret: jwks.expressJwtSecret(config.get('auth.jwks'))
}, config.get('auth.jwt')))
......@@ -85,7 +89,7 @@ const setup = async function () {
const
Profiles = require('./profiles'),
profiles = new Profiles(app)
profiles.on('message', message => console.log(message))
profiles.on('message', message => winston.debug(message))
/**
* Configure resources
......@@ -106,7 +110,7 @@ const setup = async function () {
/**
* Start server
*/
return app.listen(port, host).then(() => winston.log('info', `API started on ${host}:${port}`))
return app.listen(port, host).then(() => winston.info(`API started on ${host}:${port}`))
}
setup().catch(err => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment