Archived
Merge branch 'layout1' of https://bitbucket.org/sco44/tecnologiabanana into layout1
This commit is contained in:
+8
-16
@@ -109,18 +109,11 @@ low(new FileAsync(__dirname + '/db.json')) // production
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
});
|
||||
let setReason = function (reason='Starter', oldArr = [], prevId) {
|
||||
// if (oldObj.hasOwnProperty(reason, prevId)) {
|
||||
// ++oldObj[reason];
|
||||
// return oldObj;
|
||||
// }
|
||||
// else {
|
||||
// Object.defineProperty(oldObj,
|
||||
// reason, { value: 1, enumerable: true, writable: true }
|
||||
// )
|
||||
// return oldObj;
|
||||
// }
|
||||
let j=oldArr.findIndex(el=>el.prevId===prevId && el.reason===reason)
|
||||
if (j>=0) {++oldArr[j].timesWatched; return oldArr}
|
||||
if (j>=0) {
|
||||
++oldArr[j].timesWatched;
|
||||
return oldArr
|
||||
}
|
||||
else {
|
||||
let tmp={
|
||||
prevId,
|
||||
@@ -130,7 +123,6 @@ low(new FileAsync(__dirname + '/db.json')) // production
|
||||
oldArr.push(tmp)
|
||||
return oldArr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const videos = db.get('videos');
|
||||
@@ -157,9 +149,9 @@ low(new FileAsync(__dirname + '/db.json')) // production
|
||||
return db.defaults({ videos: [] }).write();
|
||||
})
|
||||
.then(() => {
|
||||
//app.use(express.static(__dirname + '/build')); // serve static build site
|
||||
//app.get('*', (req, res) => {
|
||||
// res.sendFile(__dirname + '/build/index.html');
|
||||
//});
|
||||
app.use(express.static(__dirname + '/build')); // serve static build site
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(__dirname + '/build/index.html');
|
||||
});
|
||||
app.listen(8000, () => console.log('listen on 8000')); // bind to port 8000 as required from specs
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user