import express from 'express';
import { PostController } from '../controllers/postController.js';

const router = express.Router();
const postController = new PostController();

router.get('/', (req, res) => postController.getAll(req, res));
router.get('/user/:userId', (req, res) => postController.getByUserId(req, res));
router.get('/:id', (req, res) => postController.getById(req, res));
router.post('/', (req, res) => postController.create(req, res));
router.put('/:id', (req, res) => postController.update(req, res));
router.delete('/:id', (req, res) => postController.delete(req, res));

export default router;
