[enh] There should be a route to view a single log

This commit is contained in:
Alban Crommer 2020-05-22 15:54:33 +00:00 committed by Alban Crommer
parent ca8dd606b7
commit 724539d88e
5 changed files with 159 additions and 132 deletions

View File

@ -58,6 +58,8 @@ function requireAuthentication( req, res, next ){
app.all('*', requireAuthentication); app.all('*', requireAuthentication);
const routes = require( "./routes"); const routes = require( "./routes");
console.log( routes.log)
app.get('/log/:id', routes.log);
app.get('/health', routes.health); app.get('/health', routes.health);
app.get('/search', routes.search); app.get('/search', routes.search);
app.post('/*', routes.add); app.post('/*', routes.add);

256
package-lock.json generated
View File

@ -14,7 +14,7 @@
"resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.5.tgz", "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.5.tgz",
"integrity": "sha512-xH2e58elpj1X4ynnKp9qSnWlsRTIs6n3tgLGNfwAGHwePw0mulHQllV34n0T25uYSu1k0hRKkWXF890B1yS47w==", "integrity": "sha512-xH2e58elpj1X4ynnKp9qSnWlsRTIs6n3tgLGNfwAGHwePw0mulHQllV34n0T25uYSu1k0hRKkWXF890B1yS47w==",
"requires": { "requires": {
"@types/babel-types": "7.0.7" "@types/babel-types": "*"
} }
}, },
"accepts": { "accepts": {
@ -22,7 +22,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"requires": { "requires": {
"mime-types": "2.1.27", "mime-types": "~2.1.24",
"negotiator": "0.6.2" "negotiator": "0.6.2"
} }
}, },
@ -36,7 +36,7 @@
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz",
"integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=",
"requires": { "requires": {
"acorn": "4.0.13" "acorn": "^4.0.4"
}, },
"dependencies": { "dependencies": {
"acorn": { "acorn": {
@ -51,7 +51,7 @@
"resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz",
"integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==",
"requires": { "requires": {
"humanize-ms": "1.2.1" "humanize-ms": "^1.2.1"
} }
}, },
"align-text": { "align-text": {
@ -59,9 +59,9 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"requires": { "requires": {
"kind-of": "3.2.2", "kind-of": "^3.0.2",
"longest": "1.0.1", "longest": "^1.0.1",
"repeat-string": "1.6.1" "repeat-string": "^1.5.2"
} }
}, },
"ansi-regex": { "ansi-regex": {
@ -89,8 +89,8 @@
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"requires": { "requires": {
"core-js": "2.6.11", "core-js": "^2.4.0",
"regenerator-runtime": "0.11.1" "regenerator-runtime": "^0.11.0"
} }
}, },
"babel-types": { "babel-types": {
@ -98,10 +98,10 @@
"resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
"integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
"requires": { "requires": {
"babel-runtime": "6.26.0", "babel-runtime": "^6.26.0",
"esutils": "2.0.3", "esutils": "^2.0.2",
"lodash": "4.17.15", "lodash": "^4.17.4",
"to-fast-properties": "1.0.3" "to-fast-properties": "^1.0.3"
} }
}, },
"babylon": { "babylon": {
@ -115,15 +115,15 @@
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"requires": { "requires": {
"bytes": "3.1.0", "bytes": "3.1.0",
"content-type": "1.0.4", "content-type": "~1.0.4",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "1.1.2", "depd": "~1.1.2",
"http-errors": "1.7.2", "http-errors": "1.7.2",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"on-finished": "2.3.0", "on-finished": "~2.3.0",
"qs": "6.7.0", "qs": "6.7.0",
"raw-body": "2.4.0", "raw-body": "2.4.0",
"type-is": "1.6.18" "type-is": "~1.6.17"
} }
}, },
"bytes": { "bytes": {
@ -141,8 +141,8 @@
"resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
"integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
"requires": { "requires": {
"align-text": "0.1.4", "align-text": "^0.1.3",
"lazy-cache": "1.0.4" "lazy-cache": "^1.0.3"
} }
}, },
"chalk": { "chalk": {
@ -150,11 +150,11 @@
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": { "requires": {
"ansi-styles": "2.2.1", "ansi-styles": "^2.2.1",
"escape-string-regexp": "1.0.5", "escape-string-regexp": "^1.0.2",
"has-ansi": "2.0.0", "has-ansi": "^2.0.0",
"strip-ansi": "3.0.1", "strip-ansi": "^3.0.0",
"supports-color": "2.0.0" "supports-color": "^2.0.0"
} }
}, },
"character-parser": { "character-parser": {
@ -162,7 +162,7 @@
"resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz",
"integrity": "sha1-x84o821LzZdE5f/CxfzeHHMmH8A=", "integrity": "sha1-x84o821LzZdE5f/CxfzeHHMmH8A=",
"requires": { "requires": {
"is-regex": "1.0.5" "is-regex": "^1.0.3"
} }
}, },
"clean-css": { "clean-css": {
@ -170,7 +170,7 @@
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
"integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==",
"requires": { "requires": {
"source-map": "0.6.1" "source-map": "~0.6.0"
} }
}, },
"cliui": { "cliui": {
@ -178,8 +178,8 @@
"resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
"integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
"requires": { "requires": {
"center-align": "0.1.3", "center-align": "^0.1.1",
"right-align": "0.1.3", "right-align": "^0.1.1",
"wordwrap": "0.0.2" "wordwrap": "0.0.2"
} }
}, },
@ -188,10 +188,10 @@
"resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz", "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz",
"integrity": "sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw==", "integrity": "sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw==",
"requires": { "requires": {
"@types/babel-types": "7.0.7", "@types/babel-types": "^7.0.0",
"@types/babylon": "6.16.5", "@types/babylon": "^6.16.2",
"babel-types": "6.26.0", "babel-types": "^6.26.0",
"babylon": "6.18.0" "babylon": "^6.18.0"
} }
}, },
"content-disposition": { "content-disposition": {
@ -269,9 +269,9 @@
"resolved": "https://registry.npmjs.org/elasticsearch/-/elasticsearch-16.7.1.tgz", "resolved": "https://registry.npmjs.org/elasticsearch/-/elasticsearch-16.7.1.tgz",
"integrity": "sha512-PL/BxB03VGbbghJwISYvVcrR9KbSSkuQ7OM//jHJg/End/uC2fvXg4QI7RXLvCGbhBuNQ8dPue7DOOPra73PCw==", "integrity": "sha512-PL/BxB03VGbbghJwISYvVcrR9KbSSkuQ7OM//jHJg/End/uC2fvXg4QI7RXLvCGbhBuNQ8dPue7DOOPra73PCw==",
"requires": { "requires": {
"agentkeepalive": "3.5.2", "agentkeepalive": "^3.4.1",
"chalk": "1.1.3", "chalk": "^1.0.0",
"lodash": "4.17.15" "lodash": "^4.17.10"
} }
}, },
"encodeurl": { "encodeurl": {
@ -304,36 +304,36 @@
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
"requires": { "requires": {
"accepts": "1.3.7", "accepts": "~1.3.7",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
"body-parser": "1.19.0", "body-parser": "1.19.0",
"content-disposition": "0.5.3", "content-disposition": "0.5.3",
"content-type": "1.0.4", "content-type": "~1.0.4",
"cookie": "0.4.0", "cookie": "0.4.0",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "1.1.2", "depd": "~1.1.2",
"encodeurl": "1.0.2", "encodeurl": "~1.0.2",
"escape-html": "1.0.3", "escape-html": "~1.0.3",
"etag": "1.8.1", "etag": "~1.8.1",
"finalhandler": "1.1.2", "finalhandler": "~1.1.2",
"fresh": "0.5.2", "fresh": "0.5.2",
"merge-descriptors": "1.0.1", "merge-descriptors": "1.0.1",
"methods": "1.1.2", "methods": "~1.1.2",
"on-finished": "2.3.0", "on-finished": "~2.3.0",
"parseurl": "1.3.3", "parseurl": "~1.3.3",
"path-to-regexp": "0.1.7", "path-to-regexp": "0.1.7",
"proxy-addr": "2.0.6", "proxy-addr": "~2.0.5",
"qs": "6.7.0", "qs": "6.7.0",
"range-parser": "1.2.1", "range-parser": "~1.2.1",
"safe-buffer": "5.1.2", "safe-buffer": "5.1.2",
"send": "0.17.1", "send": "0.17.1",
"serve-static": "1.14.1", "serve-static": "1.14.1",
"setprototypeof": "1.1.1", "setprototypeof": "1.1.1",
"statuses": "1.5.0", "statuses": "~1.5.0",
"type-is": "1.6.18", "type-is": "~1.6.18",
"utils-merge": "1.0.1", "utils-merge": "1.0.1",
"vary": "1.1.2" "vary": "~1.1.2"
} }
}, },
"finalhandler": { "finalhandler": {
@ -342,12 +342,12 @@
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"requires": { "requires": {
"debug": "2.6.9", "debug": "2.6.9",
"encodeurl": "1.0.2", "encodeurl": "~1.0.2",
"escape-html": "1.0.3", "escape-html": "~1.0.3",
"on-finished": "2.3.0", "on-finished": "~2.3.0",
"parseurl": "1.3.3", "parseurl": "~1.3.3",
"statuses": "1.5.0", "statuses": "~1.5.0",
"unpipe": "1.0.0" "unpipe": "~1.0.0"
} }
}, },
"forwarded": { "forwarded": {
@ -370,7 +370,7 @@
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"requires": { "requires": {
"function-bind": "1.1.1" "function-bind": "^1.1.1"
} }
}, },
"has-ansi": { "has-ansi": {
@ -378,7 +378,7 @@
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"requires": { "requires": {
"ansi-regex": "2.1.1" "ansi-regex": "^2.0.0"
} }
}, },
"http-errors": { "http-errors": {
@ -386,10 +386,10 @@
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
"requires": { "requires": {
"depd": "1.1.2", "depd": "~1.1.2",
"inherits": "2.0.3", "inherits": "2.0.3",
"setprototypeof": "1.1.1", "setprototypeof": "1.1.1",
"statuses": "1.5.0", "statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0" "toidentifier": "1.0.0"
} }
}, },
@ -398,7 +398,7 @@
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
"integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=",
"requires": { "requires": {
"ms": "2.0.0" "ms": "^2.0.0"
} }
}, },
"iconv-lite": { "iconv-lite": {
@ -406,7 +406,7 @@
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"requires": { "requires": {
"safer-buffer": "2.1.2" "safer-buffer": ">= 2.1.2 < 3"
} }
}, },
"inherits": { "inherits": {
@ -429,8 +429,8 @@
"resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz",
"integrity": "sha1-Oayqa+f9HzRx3ELHQW5hwkMXrJ8=", "integrity": "sha1-Oayqa+f9HzRx3ELHQW5hwkMXrJ8=",
"requires": { "requires": {
"acorn": "4.0.13", "acorn": "~4.0.2",
"object-assign": "4.1.1" "object-assign": "^4.0.1"
}, },
"dependencies": { "dependencies": {
"acorn": { "acorn": {
@ -450,7 +450,7 @@
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz",
"integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==",
"requires": { "requires": {
"has": "1.0.3" "has": "^1.0.3"
} }
}, },
"js-stringify": { "js-stringify": {
@ -463,8 +463,8 @@
"resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz",
"integrity": "sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM=", "integrity": "sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM=",
"requires": { "requires": {
"is-promise": "2.2.2", "is-promise": "^2.0.0",
"promise": "7.3.1" "promise": "^7.0.1"
} }
}, },
"kind-of": { "kind-of": {
@ -472,7 +472,7 @@
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"requires": { "requires": {
"is-buffer": "1.1.6" "is-buffer": "^1.1.5"
} }
}, },
"lazy-cache": { "lazy-cache": {
@ -566,7 +566,7 @@
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
"integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
"requires": { "requires": {
"asap": "2.0.6" "asap": "~2.0.3"
} }
}, },
"proxy-addr": { "proxy-addr": {
@ -574,7 +574,7 @@
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
"requires": { "requires": {
"forwarded": "0.1.2", "forwarded": "~0.1.2",
"ipaddr.js": "1.9.1" "ipaddr.js": "1.9.1"
} }
}, },
@ -583,14 +583,14 @@
"resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz", "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz",
"integrity": "sha512-XhoaDlvi6NIzL49nu094R2NA6P37ijtgMDuWE+ofekDChvfKnzFal60bhSdiy8y2PBO6fmz3oMEIcfpBVRUdvw==", "integrity": "sha512-XhoaDlvi6NIzL49nu094R2NA6P37ijtgMDuWE+ofekDChvfKnzFal60bhSdiy8y2PBO6fmz3oMEIcfpBVRUdvw==",
"requires": { "requires": {
"pug-code-gen": "2.0.2", "pug-code-gen": "^2.0.2",
"pug-filters": "3.1.1", "pug-filters": "^3.1.1",
"pug-lexer": "4.1.0", "pug-lexer": "^4.1.0",
"pug-linker": "3.0.6", "pug-linker": "^3.0.6",
"pug-load": "2.0.12", "pug-load": "^2.0.12",
"pug-parser": "5.0.1", "pug-parser": "^5.0.1",
"pug-runtime": "2.0.5", "pug-runtime": "^2.0.5",
"pug-strip-comments": "1.0.4" "pug-strip-comments": "^1.0.4"
} }
}, },
"pug-attrs": { "pug-attrs": {
@ -598,9 +598,9 @@
"resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.4.tgz", "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.4.tgz",
"integrity": "sha512-TaZ4Z2TWUPDJcV3wjU3RtUXMrd3kM4Wzjbe3EWnSsZPsJ3LDI0F3yCnf2/W7PPFF+edUFQ0HgDL1IoxSz5K8EQ==", "integrity": "sha512-TaZ4Z2TWUPDJcV3wjU3RtUXMrd3kM4Wzjbe3EWnSsZPsJ3LDI0F3yCnf2/W7PPFF+edUFQ0HgDL1IoxSz5K8EQ==",
"requires": { "requires": {
"constantinople": "3.1.2", "constantinople": "^3.0.1",
"js-stringify": "1.0.2", "js-stringify": "^1.0.1",
"pug-runtime": "2.0.5" "pug-runtime": "^2.0.5"
} }
}, },
"pug-code-gen": { "pug-code-gen": {
@ -608,14 +608,14 @@
"resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-2.0.2.tgz", "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-2.0.2.tgz",
"integrity": "sha512-kROFWv/AHx/9CRgoGJeRSm+4mLWchbgpRzTEn8XCiwwOy6Vh0gAClS8Vh5TEJ9DBjaP8wCjS3J6HKsEsYdvaCw==", "integrity": "sha512-kROFWv/AHx/9CRgoGJeRSm+4mLWchbgpRzTEn8XCiwwOy6Vh0gAClS8Vh5TEJ9DBjaP8wCjS3J6HKsEsYdvaCw==",
"requires": { "requires": {
"constantinople": "3.1.2", "constantinople": "^3.1.2",
"doctypes": "1.1.0", "doctypes": "^1.1.0",
"js-stringify": "1.0.2", "js-stringify": "^1.0.1",
"pug-attrs": "2.0.4", "pug-attrs": "^2.0.4",
"pug-error": "1.3.3", "pug-error": "^1.3.3",
"pug-runtime": "2.0.5", "pug-runtime": "^2.0.5",
"void-elements": "2.0.1", "void-elements": "^2.0.1",
"with": "5.1.1" "with": "^5.0.0"
} }
}, },
"pug-error": { "pug-error": {
@ -628,13 +628,13 @@
"resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.1.1.tgz", "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.1.1.tgz",
"integrity": "sha512-lFfjNyGEyVWC4BwX0WyvkoWLapI5xHSM3xZJFUhx4JM4XyyRdO8Aucc6pCygnqV2uSgJFaJWW3Ft1wCWSoQkQg==", "integrity": "sha512-lFfjNyGEyVWC4BwX0WyvkoWLapI5xHSM3xZJFUhx4JM4XyyRdO8Aucc6pCygnqV2uSgJFaJWW3Ft1wCWSoQkQg==",
"requires": { "requires": {
"clean-css": "4.2.3", "clean-css": "^4.1.11",
"constantinople": "3.1.2", "constantinople": "^3.0.1",
"jstransformer": "1.0.0", "jstransformer": "1.0.0",
"pug-error": "1.3.3", "pug-error": "^1.3.3",
"pug-walk": "1.1.8", "pug-walk": "^1.1.8",
"resolve": "1.17.0", "resolve": "^1.1.6",
"uglify-js": "2.8.29" "uglify-js": "^2.6.1"
} }
}, },
"pug-lexer": { "pug-lexer": {
@ -642,9 +642,9 @@
"resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.1.0.tgz", "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.1.0.tgz",
"integrity": "sha512-i55yzEBtjm0mlplW4LoANq7k3S8gDdfC6+LThGEvsK4FuobcKfDAwt6V4jKPH9RtiE3a2Akfg5UpafZ1OksaPA==", "integrity": "sha512-i55yzEBtjm0mlplW4LoANq7k3S8gDdfC6+LThGEvsK4FuobcKfDAwt6V4jKPH9RtiE3a2Akfg5UpafZ1OksaPA==",
"requires": { "requires": {
"character-parser": "2.2.0", "character-parser": "^2.1.1",
"is-expression": "3.0.0", "is-expression": "^3.0.0",
"pug-error": "1.3.3" "pug-error": "^1.3.3"
} }
}, },
"pug-linker": { "pug-linker": {
@ -652,8 +652,8 @@
"resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.6.tgz", "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.6.tgz",
"integrity": "sha512-bagfuHttfQOpANGy1Y6NJ+0mNb7dD2MswFG2ZKj22s8g0wVsojpRlqveEQHmgXXcfROB2RT6oqbPYr9EN2ZWzg==", "integrity": "sha512-bagfuHttfQOpANGy1Y6NJ+0mNb7dD2MswFG2ZKj22s8g0wVsojpRlqveEQHmgXXcfROB2RT6oqbPYr9EN2ZWzg==",
"requires": { "requires": {
"pug-error": "1.3.3", "pug-error": "^1.3.3",
"pug-walk": "1.1.8" "pug-walk": "^1.1.8"
} }
}, },
"pug-load": { "pug-load": {
@ -661,8 +661,8 @@
"resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.12.tgz", "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.12.tgz",
"integrity": "sha512-UqpgGpyyXRYgJs/X60sE6SIf8UBsmcHYKNaOccyVLEuT6OPBIMo6xMPhoJnqtB3Q3BbO4Z3Bjz5qDsUWh4rXsg==", "integrity": "sha512-UqpgGpyyXRYgJs/X60sE6SIf8UBsmcHYKNaOccyVLEuT6OPBIMo6xMPhoJnqtB3Q3BbO4Z3Bjz5qDsUWh4rXsg==",
"requires": { "requires": {
"object-assign": "4.1.1", "object-assign": "^4.1.0",
"pug-walk": "1.1.8" "pug-walk": "^1.1.8"
} }
}, },
"pug-parser": { "pug-parser": {
@ -670,7 +670,7 @@
"resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-5.0.1.tgz", "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-5.0.1.tgz",
"integrity": "sha512-nGHqK+w07p5/PsPIyzkTQfzlYfuqoiGjaoqHv1LjOv2ZLXmGX1O+4Vcvps+P4LhxZ3drYSljjq4b+Naid126wA==", "integrity": "sha512-nGHqK+w07p5/PsPIyzkTQfzlYfuqoiGjaoqHv1LjOv2ZLXmGX1O+4Vcvps+P4LhxZ3drYSljjq4b+Naid126wA==",
"requires": { "requires": {
"pug-error": "1.3.3", "pug-error": "^1.3.3",
"token-stream": "0.0.1" "token-stream": "0.0.1"
} }
}, },
@ -684,7 +684,7 @@
"resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-1.0.4.tgz", "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-1.0.4.tgz",
"integrity": "sha512-i5j/9CS4yFhSxHp5iKPHwigaig/VV9g+FgReLJWWHEHbvKsbqL0oP/K5ubuLco6Wu3Kan5p7u7qk8A4oLLh6vw==", "integrity": "sha512-i5j/9CS4yFhSxHp5iKPHwigaig/VV9g+FgReLJWWHEHbvKsbqL0oP/K5ubuLco6Wu3Kan5p7u7qk8A4oLLh6vw==",
"requires": { "requires": {
"pug-error": "1.3.3" "pug-error": "^1.3.3"
} }
}, },
"pug-walk": { "pug-walk": {
@ -728,7 +728,7 @@
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"requires": { "requires": {
"path-parse": "1.0.6" "path-parse": "^1.0.6"
} }
}, },
"right-align": { "right-align": {
@ -736,7 +736,7 @@
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
"integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
"requires": { "requires": {
"align-text": "0.1.4" "align-text": "^0.1.1"
} }
}, },
"safe-buffer": { "safe-buffer": {
@ -755,18 +755,18 @@
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"requires": { "requires": {
"debug": "2.6.9", "debug": "2.6.9",
"depd": "1.1.2", "depd": "~1.1.2",
"destroy": "1.0.4", "destroy": "~1.0.4",
"encodeurl": "1.0.2", "encodeurl": "~1.0.2",
"escape-html": "1.0.3", "escape-html": "~1.0.3",
"etag": "1.8.1", "etag": "~1.8.1",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "1.7.2", "http-errors": "~1.7.2",
"mime": "1.6.0", "mime": "1.6.0",
"ms": "2.1.1", "ms": "2.1.1",
"on-finished": "2.3.0", "on-finished": "~2.3.0",
"range-parser": "1.2.1", "range-parser": "~1.2.1",
"statuses": "1.5.0" "statuses": "~1.5.0"
}, },
"dependencies": { "dependencies": {
"ms": { "ms": {
@ -781,9 +781,9 @@
"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",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
"requires": { "requires": {
"encodeurl": "1.0.2", "encodeurl": "~1.0.2",
"escape-html": "1.0.3", "escape-html": "~1.0.3",
"parseurl": "1.3.3", "parseurl": "~1.3.3",
"send": "0.17.1" "send": "0.17.1"
} }
}, },
@ -807,7 +807,7 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": { "requires": {
"ansi-regex": "2.1.1" "ansi-regex": "^2.0.0"
} }
}, },
"supports-color": { "supports-color": {
@ -836,7 +836,7 @@
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"requires": { "requires": {
"media-typer": "0.3.0", "media-typer": "0.3.0",
"mime-types": "2.1.27" "mime-types": "~2.1.24"
} }
}, },
"uglify-js": { "uglify-js": {
@ -844,9 +844,9 @@
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
"integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=",
"requires": { "requires": {
"source-map": "0.5.7", "source-map": "~0.5.1",
"uglify-to-browserify": "1.0.2", "uglify-to-browserify": "~1.0.0",
"yargs": "3.10.0" "yargs": "~3.10.0"
}, },
"dependencies": { "dependencies": {
"source-map": { "source-map": {
@ -892,8 +892,8 @@
"resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz",
"integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=", "integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=",
"requires": { "requires": {
"acorn": "3.3.0", "acorn": "^3.1.0",
"acorn-globals": "3.1.0" "acorn-globals": "^3.0.0"
} }
}, },
"wordwrap": { "wordwrap": {
@ -906,9 +906,9 @@
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
"integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
"requires": { "requires": {
"camelcase": "1.2.1", "camelcase": "^1.0.2",
"cliui": "2.1.0", "cliui": "^2.1.0",
"decamelize": "1.2.0", "decamelize": "^1.0.0",
"window-size": "0.1.0" "window-size": "0.1.0"
} }
} }

View File

@ -32,14 +32,21 @@ title = function(string){
function updatePage(data){ function updatePage(data){
var content = ""; var content = "";
var item = {};
var id = '';
// If the log entry is unique, simulate a search result
if( ! data['hits'] ){
data = {hits:{hits:[data]}};
}
$.each(data.hits.hits, (k,v)=>{ $.each(data.hits.hits, (k,v)=>{
var item = v._source;
item = v._source;
id = v._id;
content += ` content += `
<div class="log row-fluid"> <div class="log row-fluid">
<div class="span9"> <div class="span9">
<p>${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)} <p><a href="/log/${id}">${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)}</a></p>
<pre> ${title(url(escape(item.content)))}</pre> <pre> ${title(url(escape(item.content)))}</pre>
</span> </span>
</div> </div>

View File

@ -68,6 +68,24 @@ const routes = {
res.status(400); res.status(400);
res.end("error"); res.end("error");
}); });
} ,
log: (req, res) => {
const id= req.params.id;
var log = client.get({
index: 'changelog',
id: id
}).then( (results, err) => {
res.render('index', {
title: 'changelog',
error: err,
data: JSON.stringify( results),
authorizationToken: process.env.AUTH_TOKEN
});
}, (e) => {
res.status(400);
res.end("error");
});
} }
}; };
module.exports = routes; module.exports = routes;

View File

@ -10,7 +10,7 @@ html(lang="en")
script(type = "text/javascript",src='/js/jquery.min.js') script(type = "text/javascript",src='/js/jquery.min.js')
body body
<nav class="navbar navbar-expand-lg navbar-light bg-light justify-content-between"> <nav class="navbar navbar-expand-lg navbar-light bg-light justify-content-between">
<a class="navbar-brand" href="#">Changelog Server</a> <a class="navbar-brand" href="/">Changelog Server</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>