Some udpates to tracking user inputs. Still not happy with it but functional so moving on
This commit is contained in:
@@ -2,20 +2,21 @@ const express = require('express');
|
||||
const router = express.Router();
|
||||
const locationsController = require('../controllers/locationsController');
|
||||
const { strictLimiter } = require('../middleware/rateLimiter');
|
||||
const { requireAuth } = require('../middleware/auth');
|
||||
|
||||
// Get all locations
|
||||
// Get all locations (public)
|
||||
router.get('/', locationsController.getAll);
|
||||
|
||||
// Get single location
|
||||
// Get single location (public)
|
||||
router.get('/:id', locationsController.getById);
|
||||
|
||||
// Create location (with rate limiting)
|
||||
router.post('/', strictLimiter, locationsController.create);
|
||||
// Create location (requires authentication)
|
||||
router.post('/', requireAuth, strictLimiter, locationsController.create);
|
||||
|
||||
// Update location (with rate limiting)
|
||||
router.put('/:id', strictLimiter, locationsController.update);
|
||||
// Update location (requires authentication)
|
||||
router.put('/:id', requireAuth, strictLimiter, locationsController.update);
|
||||
|
||||
// Delete location (with rate limiting)
|
||||
router.delete('/:id', strictLimiter, locationsController.delete);
|
||||
// Delete location (requires authentication)
|
||||
router.delete('/:id', requireAuth, strictLimiter, locationsController.delete);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user