2023-06-26 17:01:40 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
|
|
|
|
|
|
import { Router } from 'express'
|
|
|
|
|
|
|
|
// Controllers
|
2023-07-25 13:57:23 +00:00
|
|
|
import postCreateController from './posts/create'
|
|
|
|
import postDeleteController from './posts/delete'
|
|
|
|
import postInfoController from './posts/get-info'
|
|
|
|
import postUpdateController from './posts/update'
|
2023-06-26 17:01:40 +00:00
|
|
|
|
|
|
|
// Middlewares
|
|
|
|
import ensureAuthenticated from '../middlewares/ensure-authenticated'
|
|
|
|
|
|
|
|
const postsRouter = Router()
|
|
|
|
|
|
|
|
// Posts related
|
|
|
|
postsRouter.post('/create', ensureAuthenticated, postCreateController)
|
|
|
|
postsRouter.post('/delete', ensureAuthenticated, postDeleteController)
|
|
|
|
postsRouter.get('/info', postInfoController)
|
2023-06-27 23:24:26 +00:00
|
|
|
postsRouter.put('/update', ensureAuthenticated, postUpdateController)
|
2023-06-26 17:01:40 +00:00
|
|
|
|
|
|
|
export default postsRouter
|