-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (31 loc) · 1007 Bytes
/
index.js
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
38
var sql = require('mssql'),
local = require('./modules/local'),
connection = new sql.Connection(local.SQLSERVER);
// exports.itPipes = function (req, res){
connection.connect().then(function() {
var reqVideo = new sql.Request(connection);
var reqImages = new sql.Request(connection);
reqVideo.query(local.QUERIES.video).then(function(recordset_video) {
var sql = local.QUERIES.images + recordset_video[0].MLI_ID;
return {data: recordset_video[0], imageSQL: sql};
})
.then(function(data){
reqImages.query(data.imageSQL).then(function(recordset_images){
console.dir({
video: data.data,
images: recordset_images
});
return {
video: data.data,
images: recordset_images
}
}).catch(function(err){
console.log(err);
});
}).catch(function(err){
console.log(err);
});
}).catch(function(err){
console.log(err);
});
// }