consolidate all repos to one for archive
This commit is contained in:
13
projektna_naloga/web_server/routes/counterRouter.js
Normal file
13
projektna_naloga/web_server/routes/counterRouter.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const cameras = require('../data/cameras.json')
|
||||
|
||||
let count = 0;
|
||||
router.get('/', (req, res) => {
|
||||
count++;
|
||||
const i = count % cameras.length;
|
||||
const camera = cameras[i];
|
||||
return res.json(camera);
|
||||
});
|
||||
|
||||
module.exports = router;
|
30
projektna_naloga/web_server/routes/dailyDataRoutes.js
Normal file
30
projektna_naloga/web_server/routes/dailyDataRoutes.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const dailyDataController = require('../controllers/dailyDataController.js');
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
router.get('/', dailyDataController.list);
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
//router.get('/:id', dailyDataController.show);
|
||||
|
||||
/*
|
||||
* POST
|
||||
*/
|
||||
router.post('/', dailyDataController.create);
|
||||
|
||||
/*
|
||||
* PUT
|
||||
*/
|
||||
//router.put('/:id', dailyDataController.update);
|
||||
|
||||
/*
|
||||
* DELETE
|
||||
*/
|
||||
router.delete('/:id', dailyDataController.remove);
|
||||
|
||||
module.exports = router;
|
24
projektna_naloga/web_server/routes/dataRouter.js
Normal file
24
projektna_naloga/web_server/routes/dataRouter.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const hourlyDataController = require('../controllers/hourlyDataController.js');
|
||||
const dailyDataController = require('../controllers/dailyDataController.js');
|
||||
|
||||
let testData = true;
|
||||
|
||||
|
||||
|
||||
if (testData) {
|
||||
router.get('/year/:year/month/:month/day/:day/location/:location', hourlyDataController.showLocationTest);
|
||||
router.get('/year/:year/month/:month/day/:day/hour/:hour', hourlyDataController.showHourTest);
|
||||
router.get('/year/:year/month/:month/day/:day/hour/:hour/csv', hourlyDataController.showHourCsvTest);
|
||||
router.get('/year/:year/month/:month/location/:location', dailyDataController.showLocationTest);
|
||||
} else {
|
||||
router.get('/year/:year/month/:month/day/:day/location/:location', hourlyDataController.showLocation);
|
||||
router.get('/year/:year/month/:month/day/:day/hour/:hour', hourlyDataController.showHour);
|
||||
router.get('/year/:year/month/:month/day/:day/hour/:hour/csv', hourlyDataController.showHourCsv);
|
||||
router.get('/year/:year/month/:month/location/:location', dailyDataController.showLocation);
|
||||
}
|
||||
|
||||
// router.get('/year/:year/month/:month/day/:day', dailyDataController.showDay);
|
||||
|
||||
module.exports = router;
|
30
projektna_naloga/web_server/routes/hourlyDataRoutes.js
Normal file
30
projektna_naloga/web_server/routes/hourlyDataRoutes.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const hourlyDataController = require('../controllers/hourlyDataController.js');
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
router.get('/', hourlyDataController.list);
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
//router.get('/:location', hourlyDataController.show);
|
||||
|
||||
/*
|
||||
* POST
|
||||
*/
|
||||
router.post('/', hourlyDataController.create);
|
||||
|
||||
/*
|
||||
* PUT
|
||||
*/
|
||||
//router.put('/:id', hourlyDataController.update);
|
||||
|
||||
/*
|
||||
* DELETE
|
||||
*/
|
||||
router.delete('/:id', hourlyDataController.remove);
|
||||
|
||||
module.exports = router;
|
11
projektna_naloga/web_server/routes/locationRoutes.js
Normal file
11
projektna_naloga/web_server/routes/locationRoutes.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const locationController = require('../controllers/locationController.js');
|
||||
|
||||
router.get('/', locationController.list);
|
||||
|
||||
router.get('/csv', locationController.csv);
|
||||
|
||||
router.get('/:id', locationController.show);
|
||||
|
||||
module.exports = router;
|
30
projektna_naloga/web_server/routes/rawCameraDataRoutes.js
Normal file
30
projektna_naloga/web_server/routes/rawCameraDataRoutes.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const rawCameraDataController = require('../controllers/rawCameraDataController.js');
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
router.get('/', rawCameraDataController.list);
|
||||
|
||||
/*
|
||||
* GET
|
||||
*/
|
||||
router.get('/:id', rawCameraDataController.show);
|
||||
|
||||
/*
|
||||
* POST
|
||||
*/
|
||||
router.post('/', rawCameraDataController.create);
|
||||
|
||||
/*
|
||||
* PUT
|
||||
*/
|
||||
//router.put('/:id', rawCameraDataController.update);
|
||||
|
||||
/*
|
||||
* DELETE
|
||||
*/
|
||||
router.delete('/delete/:id', rawCameraDataController.remove);
|
||||
|
||||
module.exports = router;
|
20
projektna_naloga/web_server/routes/userRoutes.js
Normal file
20
projektna_naloga/web_server/routes/userRoutes.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const userController = require('../controllers/userController.js');
|
||||
|
||||
|
||||
router.get('/', userController.list);
|
||||
router.get('/profile', userController.profile);
|
||||
router.get('/logout', userController.logout);
|
||||
router.get('/savedLocation', userController.checkLocation);
|
||||
router.get('/:id', userController.show);
|
||||
|
||||
router.post('/', userController.create);
|
||||
router.post('/login', userController.login);
|
||||
|
||||
router.put('/addLocation/:id', userController.addLocation);
|
||||
router.put('/:id', userController.update);
|
||||
|
||||
router.delete('/:id', userController.remove);
|
||||
|
||||
module.exports = router;
|
Reference in New Issue
Block a user