minimonolith 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,10 +2,6 @@ import Sequelize from 'sequelize';
|
|
|
2
2
|
//import SequelizeDynamo from 'dynamo-sequelize';
|
|
3
3
|
import { loadModels } from './modelsHandler.js';
|
|
4
4
|
|
|
5
|
-
const db = process.env.DB_DB
|
|
6
|
-
const user = process.env.DB_USER;
|
|
7
|
-
const pass = process.env.DB_PASS;
|
|
8
|
-
const host = process.env.DB_ENDPOINT;
|
|
9
5
|
const dialect = 'mysql';
|
|
10
6
|
const logging = false;
|
|
11
7
|
const dialectOptions = null;
|
|
@@ -24,7 +20,10 @@ const createSequelizeInstance = () => {
|
|
|
24
20
|
sequelize = new Sequelize('sqlite::memory:');
|
|
25
21
|
sequelize.options.logging = false;
|
|
26
22
|
} else {
|
|
27
|
-
|
|
23
|
+
const db=process.env.DB_DB, user=process.env.DB_USER,
|
|
24
|
+
pass=process.env.DB_PASS, host=process.env.DB_ENDPOINT;
|
|
25
|
+
console.log(ROUTE_CODE,
|
|
26
|
+
'Trying to connect using { ' + user + ', ' + pass + ', ' + host + ', ' + db + ' }');
|
|
28
27
|
sequelize = new Sequelize(db, user, pass, { host, dialect, dialectOptions, logging });
|
|
29
28
|
}
|
|
30
29
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
2
|
|
|
3
|
-
import { loadEnvVariables } from './loadEnvVariables.js';
|
|
4
3
|
import { serverHandlerContext } from './serverHandler.js';
|
|
5
4
|
|
|
6
5
|
const runLambdaServer = (lambdaAPIHandler, port) => {
|
|
@@ -9,4 +8,4 @@ const runLambdaServer = (lambdaAPIHandler, port) => {
|
|
|
9
8
|
server.listen(port);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
export { runLambdaServer
|
|
11
|
+
export { runLambdaServer };
|
|
@@ -7,9 +7,7 @@ import { getProjectRoot } from '../pathHandler/index.js';
|
|
|
7
7
|
const loadEnvVariables = (MODULE_FOLDER='node_modules/') => {
|
|
8
8
|
const projectRootPath = url.fileURLToPath(getProjectRoot(import.meta.url, MODULE_FOLDER)+'/');
|
|
9
9
|
const envVarsPath = path.resolve(projectRootPath, '.env')
|
|
10
|
-
console.log({envVarsPath});
|
|
11
10
|
dotenv.config({ path: envVarsPath });
|
|
12
|
-
console.log(process.env);
|
|
13
11
|
};
|
|
14
12
|
|
|
15
13
|
export { loadEnvVariables };
|