reccomender similarity genere

This commit is contained in:
Giampiero Galeazzi
2019-02-28 19:19:28 +01:00
parent a4752a42da
commit 0e48971e1e
9 changed files with 51 additions and 126 deletions
+6
View File
@@ -62,6 +62,9 @@ low(new FileAsync(__dirname + '/db.json')) // production
// GET /videotrack
app.get('/videotrack', (req, res) => {
res.set({
'Access-Control-Allow-Origin': '*'
});
const videos = db.get('videos');
req.query.id ? res.send(videos.getById(req.query.id).value()) : res.send(videos.value())
});
@@ -94,5 +97,8 @@ low(new FileAsync(__dirname + '/db.json')) // production
})
.then(() => {
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
});