Skip to content

Commit

Permalink
Add compression middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
ediblecode committed Aug 17, 2016
1 parent 57807c7 commit a244270
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"node_modules"
],
"path": "."
},
{
"path": "C:\\Users\\iroutledge\\Documents\\Dev\\archive\\static-braun"
}
],
"settings":
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "NICE.Bootstrap",
"name": "NICE.Bootstrap2",
"version": "1.0.0",
"description": "",
"main": "server/index.js",
"description": "Your source for creating beautiful, consistent experiences across NICE",
"repository": "https://github.com/nhsevidence/NICE.Bootstrap2",
"main": "web/server/index.js",
"scripts": {
"start": "grunt",
"build:webpack": "webpack -d --progress --colors",
Expand All @@ -11,8 +12,8 @@
"lint": "grunt lint",
"serve": "set PORT=54321&& node server"
},
"author": "",
"license": "ISC",
"author": "NICE Digital Services",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.10.4",
"babel-loader": "^6.2.4",
Expand All @@ -38,6 +39,7 @@
"babel-eslint": "^6.1.0",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"chroma-js": "^1.1.1",
"compression": "^1.6.2",
"eslint": "^3.0.0",
"eslint-loader": "^1.4.0",
"eslint-plugin-flowtype": "^2.3.0",
Expand Down
13 changes: 8 additions & 5 deletions web/server/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*eslint-env node*/
var express = require("express"),
path = require("path"),
var _ = require("lodash"),
compression = require("compression"),
errors = require("node-common-errors"),
express = require("express"),
favicon = require("serve-favicon"),
fs = require("fs"),
_ = require("lodash"),
nunjucks = require("nunjucks"),
favicon = require("serve-favicon"),
errors = require("node-common-errors");
path = require("path");

var filters = require("./nunjucks/filters");

Expand Down Expand Up @@ -34,6 +35,8 @@ for(var name in filters) {
require("./nunjucks/example-extension")(env);
require("./nunjucks/source-extension")(env);

app.use(compression());

app.use(function (req, res, next) {
res.locals.req = req;
next();
Expand Down

0 comments on commit a244270

Please sign in to comment.