wikipedia e altro

This commit is contained in:
matteo
2019-02-18 03:58:51 +01:00
parent 61d113fd14
commit 8057a99947
7 changed files with 96 additions and 45 deletions
+4 -1
View File
@@ -68,6 +68,9 @@ low(new FileAsync(__dirname + '/db.json')) // production
// POST /videotrack
app.post('/videotrack', (req, res) => {
res.set({
'Access-Control-Allow-Origin': '*'
});
const videos = db.get('videos');
const row = videos.getById(req.body.id);
if (row.value()) {
@@ -82,7 +85,7 @@ low(new FileAsync(__dirname + '/db.json')) // production
"timesWatched": 1,
"lastWatched": new Date().toISOString(),
}
videos.push(newRow).last().write().then(output => res.send(output))
videos.push(newRow).last().write().then(output => res.send(200,output))
}
});