Skip to content

Commit 0935ce5

Browse files
authored
Merge pull request #58 from t-ho/dev
Update server deps
2 parents efeea17 + c00cf37 commit 0935ce5

12 files changed

Lines changed: 1307 additions & 1358 deletions

File tree

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

package-lock.json

Lines changed: 489 additions & 798 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"client": "node start client",
1212
"mobile": "node start mobile",
1313
"server": "node start server",
14-
"test": "node start test"
14+
"test": "node start test",
15+
"prepare": "husky install"
1516
},
1617
"repository": {
1718
"type": "git",
@@ -24,21 +25,19 @@
2425
},
2526
"homepage": "https://tdev.app/mern-stack",
2627
"devDependencies": {
27-
"chalk": "^4.1.1",
28-
"concurrently": "^6.2.0",
29-
"dotenv": "^10.0.0",
30-
"figlet": "^1.5.0",
31-
"husky": "^4.3.8",
28+
"chalk": "^4.1.2",
29+
"concurrently": "^7.0.0",
30+
"dotenv": "^16.0.0",
31+
"figlet": "^1.5.2",
32+
"husky": "^7.0.4",
33+
"lint-staged": "^12.3.4",
3234
"lodash": "^4.17.21",
33-
"ngrok": "^4.0.1",
34-
"prettier": "^2.3.0",
35-
"pretty-quick": "^3.1.0",
35+
"ngrok": "^4.3.0",
36+
"prettier": "^2.5.1",
3637
"tree-kill": "^1.2.2"
3738
},
3839
"dependencies": {},
39-
"husky": {
40-
"hooks": {
41-
"pre-commit": "pretty-quick --staged"
42-
}
40+
"lint-staged": {
41+
"*.{js,css,md}": "prettier --write"
4342
}
4443
}

server/config/config.default.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ let defaultConfig = {
4040
to: '',
4141
signature: 'The MERN Team', // TODO
4242
},
43+
etag: {
44+
enabled: true,
45+
},
4346
jwt: {
4447
secret: 'This will be overriden by environment variable JWT_SECRET',
4548
algorithm: 'HS512',

server/config/config.dev.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ let devConfig = {
1313
resetPassword: false, // If true, be able to reset password via email
1414
verifyEmail: false, // If true, require email verification when signing up
1515
},
16+
etag: {
17+
enabled: false,
18+
},
1619
morgan: {
1720
format: constants.MORGAN_FORMAT_DEV, // TODO: possible values: combined, common, dev, short, tiny
1821
},

server/core/express.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ if (config.cors.enabled) {
3838
app.use(cors(config.cors.options));
3939
}
4040

41+
app.set('etag', config.etag.enabled);
42+
4143
// Support parsing of application/x-www-form-urlencoded post data
4244
// app.use(express.urlencoded({ extended: true }));
4345

server/core/mongoose.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ require('../models');
77

88
mongoose.Promise = global.Promise;
99

10-
mongoose.set('useCreateIndex', true); // FIXME: fix deprecation warnings
11-
mongoose.set('useNewUrlParser', true); // FIXME: fix deprecation warnings
12-
mongoose.set('useUnifiedTopology', true); // FIXME: fix deprecation warnings
13-
1410
if (config.env !== constants.ENV_TEST) {
1511
mongoose.connect(config.mongo.uri);
1612
mongoose.connection.once('open', () => {

server/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const displayConfigurationStatus = () => {
4646
);
4747
console.log(chalk.gray(`[*] Compression: ${config.compression.enabled}`));
4848
console.log(chalk.gray(`[*] Cors: ${config.cors.enabled}`));
49+
console.log(chalk.gray(`[*] Etag: ${config.etag.enabled}`));
4950
console.log(chalk.gray(`[*] Helmet: ${config.helmet.enabled}`));
5051
console.log(chalk.gray(`[*] Morgan: ${config.morgan.enabled}`));
5152
console.log(chalk.gray(`[*] RateLimit: ${config.rateLimit.enabled}`));

0 commit comments

Comments
 (0)