From f0187f14f9b7ca28e2e23655559140e80c5ad5fa Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sat, 5 Aug 2017 21:54:35 +0100 Subject: [PATCH] Re work --- app.js | 4 +++- package-lock.json | 45 +++++++++++++++++++++++++++++++++++++++++++-- package.json | 1 + views/index.html | 37 ------------------------------------- 4 files changed, 47 insertions(+), 40 deletions(-) diff --git a/app.js b/app.js index a8c9f29..7510ca5 100644 --- a/app.js +++ b/app.js @@ -7,13 +7,15 @@ const config = require('./config'); const base58 = require('./base58.js'); const log4js = require('log4js'); const logger = log4js.getLogger(); +const compression = require('compression'); + logger.level = 'debug'; // grab the url model const Url = require('./models/url'); mongoose.connect('mongodb://' + config.db.host + '/' + config.db.name); - +app.use(compression()); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); diff --git a/package-lock.json b/package-lock.json index 58e4077..309d249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -960,6 +960,43 @@ "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", "dev": true }, + "compressible": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.11.tgz", + "integrity": "sha1-FnGKdd4oPtjmBAQWJaIGRYZ5fYo=", + "requires": { + "mime-db": "1.29.0" + } + }, + "compression": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.0.tgz", + "integrity": "sha1-AwyfGY8WQ6BX13anOOki2kNzAS0=", + "requires": { + "accepts": "1.3.3", + "bytes": "2.5.0", + "compressible": "2.0.11", + "debug": "2.6.8", + "on-headers": "1.0.1", + "safe-buffer": "5.1.1", + "vary": "1.1.1" + }, + "dependencies": { + "bytes": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.5.0.tgz", + "integrity": "sha1-TJQj6i0lLCcMQbK97+/5u2tiwGo=" + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5604,6 +5641,11 @@ "ee-first": "1.1.1" } }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -6786,8 +6828,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, "sass-graph": { "version": "2.2.4", diff --git a/package.json b/package.json index c647ce9..7510325 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "body-parser": "^1.14.1", + "compression": "^1.7.0", "express": "^4.13.3", "mongoose": "4.2.9" }, diff --git a/views/index.html b/views/index.html index db8bb12..90590e5 100644 --- a/views/index.html +++ b/views/index.html @@ -7,7 +7,6 @@ nURL - @@ -29,42 +28,6 @@ - -