mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-29 09:51:16 +00:00
23 lines
724 B
TypeScript
23 lines
724 B
TypeScript
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||
|
|
||
|
import { Router } from 'express'
|
||
|
|
||
|
// Controllers
|
||
|
import postCreateController from './posts/post-create'
|
||
|
import postDeleteController from './posts/post-delete'
|
||
|
import postInfoController from './posts/post-info'
|
||
|
import postUpdateController from './posts/post-update'
|
||
|
|
||
|
// 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)
|
||
|
postsRouter.put('/update', postUpdateController)
|
||
|
|
||
|
export default postsRouter
|