Added compression
This commit is contained in:
parent
a2e3afb01d
commit
58bedb277d
7
app.js
7
app.js
@ -2,6 +2,7 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
|
const compress = require('compression');
|
||||||
const app = express();
|
const app = express();
|
||||||
const Metalsmith = require('metalsmith');
|
const Metalsmith = require('metalsmith');
|
||||||
const inplace = require('metalsmith-in-place');
|
const inplace = require('metalsmith-in-place');
|
||||||
@ -20,6 +21,7 @@ const moment = require('moment');
|
|||||||
const port = process.env.PORT || 8000;
|
const port = process.env.PORT || 8000;
|
||||||
|
|
||||||
app.use(express.static(__dirname + '/build'));
|
app.use(express.static(__dirname + '/build'));
|
||||||
|
app.use(compress());
|
||||||
|
|
||||||
var md = markdown('commonmark', {html: true});
|
var md = markdown('commonmark', {html: true});
|
||||||
md.parser.use(emoji);
|
md.parser.use(emoji);
|
||||||
@ -51,6 +53,11 @@ Metalsmith(__dirname)
|
|||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
pattern: 'pages/*'
|
pattern: 'pages/*'
|
||||||
|
},
|
||||||
|
experience: {
|
||||||
|
pattern: 'experience/*',
|
||||||
|
sortBy: 'start',
|
||||||
|
reverse: true
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.use(inplace({
|
.use(inplace({
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
"start": "node app.js"
|
"start": "node app.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"compression": "^1.6.2",
|
||||||
"express": "^4.13.4",
|
"express": "^4.13.4",
|
||||||
"handlebars": "^4.0.5",
|
"handlebars": "^4.0.5",
|
||||||
"markdown-it-emoji": "^1.1.1",
|
"markdown-it-emoji": "^1.1.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user