mostly adding posts controller and model but also updating some users stuff

This commit is contained in:
Will Baumbach
2025-07-25 16:33:34 -05:00
parent 11afa68c09
commit 2704577d39
5 changed files with 153 additions and 3 deletions

21
api/routes/posts.js Normal file
View File

@@ -0,0 +1,21 @@
import express from 'express';
import { createPost, deletePost, getAllPosts, getAllPostsByUser, getPost, updatePost } from './../controllers/usersController.js';
const router = express.Router();
router
.route('/')
.get(getAllPosts)
.post(createPost);
router
.route('/:id')
.get(getPost)
.patch(updatePost)
.delete(deletePost);
router
.route('/:user')
.get(getAllPostsByUser)
export default router;