consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;