lms-sync 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/apiConnections/mapping.js +0 -3
- package/app.js +13 -8
- package/package.json +1 -1
- package/recordError.log +1463 -0
- package/recordSuccess.log +33 -0
@@ -1189,11 +1189,8 @@ const server = {
|
|
1189
1189
|
console.log("");
|
1190
1190
|
|
1191
1191
|
const studentApi = (await api.Student()).data
|
1192
|
-
|
1193
|
-
const sectionsApi = await api.Section()
|
1194
1192
|
const instructorApi = await api.Instructor()
|
1195
1193
|
|
1196
|
-
|
1197
1194
|
const studentSeq = await Students.findAll()
|
1198
1195
|
const courseSeq = await Courses.findAll()
|
1199
1196
|
const campusSeq = await Campuses.findAll()
|
package/app.js
CHANGED
@@ -1,25 +1,30 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
const express = require('express')
|
3
|
-
const app = express()
|
4
2
|
|
5
3
|
const sequelizeStart = require('./apiConnections/sequelizeConnection');
|
6
4
|
const apiConnects = require('./apiConnections/apiConnects')
|
7
|
-
const mappings = require('./apiConnections/mapping')
|
5
|
+
const mappings = require('./apiConnections/mapping');
|
8
6
|
|
9
7
|
|
10
8
|
async function start(){
|
11
9
|
try {
|
12
10
|
|
13
|
-
|
11
|
+
const apis = await apiConnects.ApiConnections()
|
12
|
+
if(apis){
|
13
|
+
console.log('Connected to Apis.');
|
14
|
+
console.log(`Api link:`, apis.api.baseURL);
|
15
|
+
}
|
14
16
|
const startSequel = await sequelizeStart.getSequelConnection();
|
15
17
|
if (startSequel) {
|
16
18
|
console.log('Connected to Sequelize.');
|
17
19
|
console.log(`Sequelize host:`, startSequel.config.host);
|
18
|
-
}
|
19
|
-
|
20
|
+
}
|
21
|
+
if(apis && startSequel){
|
22
|
+
console.log('Both connections successful. Starting migrations...');
|
23
|
+
await mappings.executeAll()
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
console.error('Failed to establish database and api connections. Migrations not started.');
|
20
27
|
}
|
21
|
-
|
22
|
-
await mappings.executeAll()
|
23
28
|
} catch (error) {
|
24
29
|
console.error('error :>> ', error);
|
25
30
|
}
|