21 lines
686 B
JavaScript
21 lines
686 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const locationsController = require('../controllers/locationsController');
|
|
const { strictLimiter } = require('../middleware/rateLimiter');
|
|
|
|
// Get all locations
|
|
router.get('/', locationsController.getAll);
|
|
|
|
// Get single location
|
|
router.get('/:id', locationsController.getById);
|
|
|
|
// Create location (with rate limiting)
|
|
router.post('/', strictLimiter, locationsController.create);
|
|
|
|
// Update location (with rate limiting)
|
|
router.put('/:id', strictLimiter, locationsController.update);
|
|
|
|
// Delete location (with rate limiting)
|
|
router.delete('/:id', strictLimiter, locationsController.delete);
|
|
|
|
module.exports = router; |