Started api

This commit is contained in:
Kasper Rynning-Tønnesen
2019-01-18 17:02:28 +01:00
parent 770e25a88a
commit 1ff0de31bc
2 changed files with 17 additions and 1 deletions

View File

@@ -123,7 +123,7 @@ function list(msg, guid, coll, offline, socket) {
}
}
function skip(list, guid, coll, offline, socket) {
function skip(list, guid, coll, offline, socket, callback) {
var socketid = socket.zoff_id;
if(list !== undefined && list !== null && list !== "")

View File

@@ -271,6 +271,22 @@ router.route('/api/list/:channel_name/:video_id').delete(function(req, res) {
});
});
router.route('/api/skip/:channel_name').post(function(req, res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header({"Content-Type": "application/json"});
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
var api_key = req.body.api_key;
var id = req.body.id;
var guid = req.body.chat_name;
//CHECK API KEY FOR ZOFFBOT
List.skip(list, guid, channel_name, false, undefined, function(skipped, text) {
})
})
router.route('/api/conf/:channel_name').put(function(req, res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");