project-knedita/src/controllers/posts-router.ts

23 lines
482 B
TypeScript
Raw Normal View History

import { Router } from 'express'
// Controllers
2023-07-28 13:41:28 +00:00
import post from './posts'
// Middlewares
import authenticated from 'middlewares/authenticated'
const postsRouter = Router()
2023-07-28 13:41:28 +00:00
// GET
postsRouter.get('/fetch-likes', post.fetchLikes)
postsRouter.get('/info', post.fetch)
// POST
postsRouter.post('/create', authenticated, post.create)
postsRouter.post('/delete', authenticated, post.delete)
// PUT
postsRouter.put('/update', authenticated, post.update)
export default postsRouter