From a3d5ecf460958e258e72beb3a34f764d953c3c42 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sun, 1 Oct 2017 10:51:10 +0100 Subject: [PATCH] starting --- .gitignore | 5 + config.js | 5 +- http:%2F%2Fsilvrtree.co.uk%2Fslack.html | 411 ++++++++++++++++++++++++ package-lock.json | 207 ++++++------ package.json | 8 +- server.js | 9 +- 6 files changed, 534 insertions(+), 111 deletions(-) create mode 100644 http:%2F%2Fsilvrtree.co.uk%2Fslack.html diff --git a/.gitignore b/.gitignore index ff8333e..c0166a5 100644 --- a/.gitignore +++ b/.gitignore @@ -189,3 +189,8 @@ node_modules npm-debug.log testem.log /lib/newdata.json + +# Elastic Beanstalk Files +.elasticbeanstalk/* +!.elasticbeanstalk/*.cfg.yml +!.elasticbeanstalk/*.global.yml diff --git a/config.js b/config.js index 5c797e1..c694ce5 100644 --- a/config.js +++ b/config.js @@ -3,9 +3,6 @@ const config = {}; config.db = {}; // config.webhost = 'http://nurl.co/'; config.webhost = 'http://localhost:7000/'; -config.port = 6566; - -config.db.host = 'localhost'; -config.db.name = 'url_shortener'; +config.port = process.env.PORT || 6566; module.exports = config; diff --git a/http:%2F%2Fsilvrtree.co.uk%2Fslack.html b/http:%2F%2Fsilvrtree.co.uk%2Fslack.html new file mode 100644 index 0000000..82d0a16 --- /dev/null +++ b/http:%2F%2Fsilvrtree.co.uk%2Fslack.html @@ -0,0 +1,411 @@ + + + + + + + + Events + + + + + + + + + + + + +
+
+
+
+
+ +
+ +
+ +
+ + + + + +
+ + + + +
+
Travel
+ +
+ +
+ +
+ +
+ + +
+
+
Computer Software, etc.
+ +
+ +
+
Reference & Special sites
+ + +
+ + +
+ + +
+ +
+
+ + + + + + + diff --git a/package-lock.json b/package-lock.json index de5e531..73f3678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,9 +56,9 @@ "optional": true }, "apicache": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/apicache/-/apicache-0.11.2.tgz", - "integrity": "sha512-olsFYz/fxxJPnZ3I8KG9CL40PaibfWhXJ+C0JO2ti4N3xsnCJ3plm50tj4eBguMqHaUBBVqsaFGyfZ8vpyZXEg==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/apicache/-/apicache-1.1.0.tgz", + "integrity": "sha512-xgsrQM5oMcgcFtYDyFC6AZzNvvrj23WbV/PGUFfhyQPQRSIvPTUpcjQ4USAcJbnnaAzyIUHv+Xk+mdeHiEjafQ==" }, "array-flatten": { "version": "1.1.1", @@ -76,9 +76,9 @@ "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" }, "ast-types": { - "version": "0.9.12", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.12.tgz", - "integrity": "sha1-sTYwDWcCZiWuFTJpgsqZGOXbc8k=", + "version": "0.9.13", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.13.tgz", + "integrity": "sha512-72w1vrspLfSP4htDZWMgDya3gz7VFIojiaxWdXfJkpR/KouBvJZ2xoHxG79VwdGr8ZdG/b6zgwqoIG24QtRqCQ==", "optional": true }, "async": { @@ -133,19 +133,19 @@ } }, "body-parser": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.0.tgz", - "integrity": "sha1-07Ik1Gf6LOjUNYnAJFBDJnwJNjQ=", + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.3", - "debug": "2.6.8", + "content-type": "1.0.4", + "debug": "2.6.9", "depd": "1.1.1", "http-errors": "1.6.2", - "iconv-lite": "0.4.18", + "iconv-lite": "0.4.19", "on-finished": "2.3.0", - "qs": "6.5.0", - "raw-body": "2.3.1", + "qs": "6.5.1", + "raw-body": "2.3.2", "type-is": "1.6.15" } }, @@ -220,9 +220,9 @@ "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.3.tgz", - "integrity": "sha1-2hjvL7ZMpqzJBcxyAX0/OBhbkdE=" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "cookie": { "version": "0.3.1", @@ -274,9 +274,9 @@ "integrity": "sha1-vn32jsJw/Z7HhIK9hb5oyPuPvrw=" }, "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } @@ -293,7 +293,7 @@ "integrity": "sha1-/PSQo37OJmRk2cxDGrmMWBnO0JU=", "optional": true, "requires": { - "ast-types": "0.9.12", + "ast-types": "0.9.13", "escodegen": "1.9.0", "esprima": "3.1.3" } @@ -380,43 +380,52 @@ "optional": true }, "etag": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", - "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, "express": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.15.4.tgz", - "integrity": "sha1-Ay4iU0ic+PzgJma+yj0R7XotrtE=", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.1.tgz", + "integrity": "sha512-STB7LZ4N0L+81FJHGla2oboUHTk4PaN1RsOkoRh9OSeEKylvF5hwKYVX1xCLFaCT7MD0BNG/gX2WFMLqY6EMBw==", "requires": { "accepts": "1.3.4", "array-flatten": "1.1.1", + "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.3", + "content-type": "1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", - "debug": "2.6.8", + "debug": "2.6.9", "depd": "1.1.1", "encodeurl": "1.0.1", "escape-html": "1.0.3", - "etag": "1.8.0", - "finalhandler": "1.0.4", - "fresh": "0.5.0", + "etag": "1.8.1", + "finalhandler": "1.1.0", + "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "1.1.2", "on-finished": "2.3.0", "parseurl": "1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "1.1.5", - "qs": "6.5.0", + "proxy-addr": "2.0.2", + "qs": "6.5.1", "range-parser": "1.2.0", - "send": "0.15.4", - "serve-static": "1.12.4", - "setprototypeof": "1.0.3", + "safe-buffer": "5.1.1", + "send": "0.16.1", + "serve-static": "1.13.1", + "setprototypeof": "1.1.0", "statuses": "1.3.1", "type-is": "1.6.15", - "utils-merge": "1.0.0", - "vary": "1.1.1" + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + } } }, "extend": { @@ -442,11 +451,11 @@ "optional": true }, "finalhandler": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", - "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", "requires": { - "debug": "2.6.8", + "debug": "2.6.9", "encodeurl": "1.0.1", "escape-html": "1.0.3", "on-finished": "2.3.0", @@ -461,7 +470,7 @@ "integrity": "sha1-jjQpjL0uF28lTv/sdaHHjMhJ/Tc=", "optional": true, "requires": { - "debug": "2.6.8" + "debug": "2.6.9" } }, "forever-agent": { @@ -480,14 +489,14 @@ } }, "forwarded": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.1.tgz", - "integrity": "sha1-ik4wxkCwU5U5mjVJxzAldygEiWE=" + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, "fresh": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", - "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, "ftp": { "version": "0.3.10", @@ -541,7 +550,7 @@ "optional": true, "requires": { "data-uri-to-buffer": "1.2.0", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1", "file-uri-to-path": "1.0.0", "ftp": "0.3.10", @@ -634,7 +643,7 @@ "integrity": "sha1-zBzjjkU7+YSg93AtLdWcc9CBKEo=", "requires": { "agent-base": "2.1.1", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1" } }, @@ -673,14 +682,14 @@ "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", "requires": { "agent-base": "2.1.1", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1" } }, "iconv-lite": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz", - "integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA==" + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, "inflection": { "version": "1.10.0", @@ -700,9 +709,9 @@ "optional": true }, "ipaddr.js": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", - "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", + "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" }, "is-my-json-valid": { "version": "2.16.1", @@ -840,13 +849,13 @@ "optional": true }, "log4js": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-2.3.3.tgz", - "integrity": "sha1-GLrAtbEFLRB40l59mwzymPSZ2RU=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-2.3.4.tgz", + "integrity": "sha1-+tOZKLKESHVWiPhhE53c7nG2NX8=", "requires": { "axios": "0.15.3", "date-format": "1.1.0", - "debug": "2.6.8", + "debug": "2.6.9", "hipchat-notifier": "1.1.0", "loggly": "1.1.1", "mailgun-js": "0.7.15", @@ -1012,9 +1021,9 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { "version": "1.30.0", @@ -1183,13 +1192,13 @@ "optional": true, "requires": { "agent-base": "2.1.1", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1", "get-uri": "2.0.1", "http-proxy-agent": "1.0.0", "https-proxy-agent": "1.0.0", "pac-resolver": "2.0.0", - "raw-body": "2.3.1", + "raw-body": "2.3.2", "socks-proxy-agent": "2.1.1" } }, @@ -1286,12 +1295,12 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" }, "proxy-addr": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", - "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", + "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", "requires": { - "forwarded": "0.1.1", - "ipaddr.js": "1.4.0" + "forwarded": "0.1.2", + "ipaddr.js": "1.5.2" } }, "proxy-agent": { @@ -1301,7 +1310,7 @@ "optional": true, "requires": { "agent-base": "2.1.1", - "debug": "2.6.8", + "debug": "2.6.9", "extend": "3.0.1", "http-proxy-agent": "1.0.0", "https-proxy-agent": "1.0.0", @@ -1322,9 +1331,9 @@ "optional": true }, "qs": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", - "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==" + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" }, "querystring": { "version": "0.2.0", @@ -1337,13 +1346,13 @@ "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, "raw-body": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.1.tgz", - "integrity": "sha512-sxkd1uqaSj41SG5Vet9sNAxBMCMsmZ3LVhRkDlK8SbCpelTUB7JiMGHG70AZS6cFiCRgfNQhU2eLnTHYRFf7LA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", "requires": { "bytes": "3.0.0", "http-errors": "1.6.2", - "iconv-lite": "0.4.18", + "iconv-lite": "0.4.19", "unpipe": "1.0.0" } }, @@ -1452,19 +1461,19 @@ "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "send": { - "version": "0.15.4", - "resolved": "https://registry.npmjs.org/send/-/send-0.15.4.tgz", - "integrity": "sha1-mF+qPihLAnPHkzZKNcZze9k5Bbk=", + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", + "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", "requires": { - "debug": "2.6.8", + "debug": "2.6.9", "depd": "1.1.1", "destroy": "1.0.4", "encodeurl": "1.0.1", "escape-html": "1.0.3", - "etag": "1.8.0", - "fresh": "0.5.0", + "etag": "1.8.1", + "fresh": "0.5.2", "http-errors": "1.6.2", - "mime": "1.3.4", + "mime": "1.4.1", "ms": "2.0.0", "on-finished": "2.3.0", "range-parser": "1.2.0", @@ -1472,14 +1481,14 @@ } }, "serve-static": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.4.tgz", - "integrity": "sha1-m2qpjutyU8Tu3Ewfb9vKYJkBqWE=", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", + "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", "requires": { "encodeurl": "1.0.1", "escape-html": "1.0.3", "parseurl": "1.3.2", - "send": "0.15.4" + "send": "0.16.1" } }, "setprototypeof": { @@ -1583,7 +1592,7 @@ "integrity": "sha1-K/5lDCW2qQqyVRWpC7W5uU45jw8=", "requires": { "date-format": "1.1.0", - "debug": "2.6.8", + "debug": "2.6.9", "mkdirp": "0.5.1", "readable-stream": "2.3.3" }, @@ -1741,9 +1750,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { "version": "3.1.0", @@ -1751,9 +1760,9 @@ "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" }, "vary": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz", - "integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc=" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "verror": { "version": "1.10.0", diff --git a/package.json b/package.json index 1b6b816..f4c0f3b 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "author": "", "license": "ISC", "dependencies": { - "apicache": "^0.11.2", - "body-parser": "^1.18.0", - "express": "^4.15.4", + "apicache": "^1.1.0", + "body-parser": "^1.18.2", + "express": "^4.16.1", "http": "0.0.0", "https": "^1.0.0", - "log4js": "^2.3.3", + "log4js": "^2.3.4", "path": "^0.12.7", "request-promise-cache": "^1.0.6", "url": "^0.11.0" diff --git a/server.js b/server.js index 41e8669..4f3110a 100644 --- a/server.js +++ b/server.js @@ -1,9 +1,8 @@ const express = require('express'); const app = express(); -const path = require('path'); const bodyParser = require('body-parser'); -const config = require('./config'); +// const config = require('./config'); const log4js = require('log4js'); const logger = log4js.getLogger(); @@ -12,6 +11,8 @@ const http = require('http'); const https = require('https'); const apicache = require('apicache'); +const port = process.env.PORT || 6566; + logger.level = 'debug'; // app.use(compression()); @@ -92,6 +93,6 @@ function getUrl (req, res) { app.get('/:encoded_id', getUrl); -const server = app.listen(config.port, () => { - logger.info(`Server listening on port ${config.port}`); +const server = app.listen(port, () => { + logger.info(`Server listening on port ${port}`); });