Skip to content

Commit

Permalink
including gzip optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
samilabud committed Jul 29, 2021
1 parent 10200f7 commit 064d0fc
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
83 changes: 79 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"cors": "2.8.5",
"dotenv": "7.0.0",
"express": "^4.16.4",
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const express = require('express');
//const cors = require('cors'); //ya no se necesita
//const bodyParser = require('body-parser'); Ya no se usa, ahora se usa el mismo express, ver debajo
const path = require('path');
const compression = require('compression');

//usar el .env si no estamos en produccion, de lo contrario setear las variables en produccion tipo:
//heroku config:set STRYPE_SECRET_KEY=1234
Expand All @@ -16,7 +17,7 @@ const port = process.env.PORT || 5000;

//app.use(bodyParser.json());
//app.use(bodyParser.urlencoded({extended:true})) deprecated, usar como se indica debajo

app.use(compression());
app.use(express.urlencoded({extended: false})); //parsear el request por post y html por form url encoded
app.use(express.json()); //parsear el request por json

Expand Down

0 comments on commit 064d0fc

Please sign in to comment.