-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (31 loc) · 2.8 KB
/
index.js
File metadata and controls
37 lines (31 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const express = require('express');
const app = express();
const PORT = 3000;
const handlebarsConfig_INIT = require('./config/handlebarsConfig');
const expressConfig_INIT = require('./config/expressConfig');
const mongooseConfig_INIT = require('./config/mongooseConfig');
const routes = require('./router');
const dbConfig = require('./database/config')
mongooseConfig_INIT();
handlebarsConfig_INIT(app);
expressConfig_INIT(app, express);
app.use(routes);
app.listen(PORT, () => {
console.log('Server is running on port ' + PORT);
/// IMPORTANT SECURITY CHECK ///
const defaultJsonWebToken = dbConfig.JWT.SECRET_TOKEN === 'SECRET_MESSAGE';
if (defaultJsonWebToken) {
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
`);
}
})