Spaces:
Sleeping
Sleeping
File size: 422 Bytes
3ec134e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // backend/src/posts/router.ts
import { Router } from 'express';
import { list, bySlug, create, update, remove } from './controller';
import { adminAuth } from '../auth/middleware';
export const postsRouter = Router();
postsRouter.get('/', list);
postsRouter.get('/:slug', bySlug);
postsRouter.post('/', adminAuth, create);
postsRouter.put('/:slug', adminAuth, update);
postsRouter.delete('/:slug', adminAuth, remove);
|