Skip to content

Commit b0d8424

Browse files
author
Jitendra Kumar
committed
changed structure
1 parent 1987d1c commit b0d8424

37 files changed

+180
-558
lines changed

config/env/common.js

-4
This file was deleted.

config/env/development.js

Whitespace-only changes.

config/env/index.js

-7
This file was deleted.

config/env/local.js

-13
This file was deleted.

config/env/production.js

Whitespace-only changes.

config/env/staging.js

Whitespace-only changes.

config/env/test.js

-13
This file was deleted.

config/lib/guard/index.js

-6
This file was deleted.

config/lib/guard/jwt.guard.js

-15
This file was deleted.

config/lib/guard/xss.guard.js

-13
This file was deleted.

config/lib/helper_lib/middleware.js

-135
This file was deleted.

config/lib/multer/multer.js

Whitespace-only changes.

config/lib/routes/routes.js

-32
This file was deleted.

config/lib/server/index.js

-9
This file was deleted.

configuration/config.dev.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"PAGE_LIMIT": 20,
3+
"PORT": 3005,
4+
"MONGODB": "nodeJsStructure",
5+
"MONGO_DEBUG": true,
6+
"MODE_TYPE": "localhost",
7+
"HOST": "localhost",
8+
"JWT_KEY": "Secure!<_--@>#?$:%+(^^{+_)JwT:KeY(&*[]./,01sre;,___private.jwt.key",
9+
"ENCRYPTION_KEY": "SeCuRe!/*.%,#3@+__EnCrYpTiOn_KeY",
10+
"ENCRYPTION_ALGO": "aes-256-cbc",
11+
"JWT_GEN_KEY": "lOcAlToKeN!1995@$&>"
12+
}

configuration/config.prod.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"PAGE_LIMIT": 20,
3+
"PORT": 3005,
4+
"MONGODB": "nodeJsStructure",
5+
"MONGO_DEBUG": true,
6+
"MODE_TYPE": "localhost",
7+
"HOST": "localhost",
8+
"JWT_KEY": "Secure!<_--@>#?$:%+(^^{+_)JwT:KeY(&*[]./,01sre;,___private.jwt.key",
9+
"ENCRYPTION_KEY": "SeCuRe!/*.%,#3@+__EnCrYpTiOn_KeY",
10+
"ENCRYPTION_ALGO": "aes-256-cbc",
11+
"JWT_GEN_KEY": "lOcAlToKeN!1995@$&>"
12+
}

configuration/config.test.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"PAGE_LIMIT": 20,
3+
"PORT": 3005,
4+
"MONGODB": "nodeJsStructure",
5+
"MONGO_DEBUG": true,
6+
"MODE_TYPE": "localhost",
7+
"HOST": "localhost",
8+
"JWT_KEY": "Secure!<_--@>#?$:%+(^^{+_)JwT:KeY(&*[]./,01sre;,___private.jwt.key",
9+
"ENCRYPTION_KEY": "SeCuRe!/*.%,#3@+__EnCrYpTiOn_KeY",
10+
"ENCRYPTION_ALGO": "aes-256-cbc",
11+
"JWT_GEN_KEY": "lOcAlToKeN!1995@$&>"
12+
}

configuration/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
getConfig: () => {
5+
return require(path.resolve(`./configuration/config.${process.env.NODE_ENV}.json`));
6+
}
7+
}

database/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
connectMongoDB: require('./mongodb_connection')
3+
}

config/lib/database/mongodb_connection.js renamed to database/mongodb_connection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const mongoose = require("mongoose"),
22
chalk = require("chalk");
33

4-
module.exports = function(ENV) {
4+
module.exports = (ENV) => {
55
mongoose.Promise = global.Promise;
66
mongoose.set("debug", ENV.MONGO_DEBUG);
77

config/lib/express/express.js renamed to express.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const helmet = require("helmet"),
44
morgan = require("morgan"),
55
bodyParser = require("body-parser");
66

7-
module.exports = function(app) {
7+
exports.init = (app) => {
88
//@ used helmet to secure headers
99
app.use(helmet());
1010

@@ -15,7 +15,7 @@ module.exports = function(app) {
1515
app.use(bodyParser.json());
1616

1717
//@ allow/enable cross origin request
18-
app.use(function(req, res, next) {
18+
app.use(function (req, res, next) {
1919
res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE");
2020
res.header("Access-Control-Allow-Origin", "*");
2121
res.header(

0 commit comments

Comments
 (0)