setup api

This commit is contained in:
cv
2021-04-07 14:50:14 +02:00
parent e20d9d91ae
commit 115b4f6100
11 changed files with 228 additions and 68 deletions
+16
View File
@@ -0,0 +1,16 @@
// import json with initial data
const playbackState = require('../data/playbackData.json');
// Create controller for GET request to '/pb'
// Returns ACK message
exports.pbGet = async (req, res) => {
// ?? Do i need to wrap this in an object?
res.send({ response: 'Playback Controller API' });
};
// Create controller for GET request to '/pb/all'
// Returns playback state object
exports.pbGetAll = async (req, res) => {
res.json(playbackState);
};