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
+19
View File
@@ -0,0 +1,19 @@
const express = require('express');
const cors = require('cors');
const router = express.Router();
// Cross origin stuff
const corsOptions = {
origin: 'http://localhost',
};
// import event controller
const playbackController = require('../controllers/playbackController');
// create route between controller and '/playback' endpoint
router.get('/', cors(corsOptions), playbackController.pbGet);
// create route between controller and '/playback/all' endpoint
router.get('/all', cors(corsOptions), playbackController.pbGetAll);
module.exports = router;