12 lines
550 B
JavaScript
12 lines
550 B
JavaScript
const express = require('express');
|
|
const {addFollowUser, deleteFollowUser, getParamUsername, getProfile} = require('../../../controllers/profiles.controller');
|
|
const auth = require('../../../middlewares/auth');
|
|
|
|
const profilesRouter = express.Router();
|
|
|
|
profilesRouter.param('username', getParamUsername);
|
|
profilesRouter.get('/:username', auth.required, getProfile);
|
|
profilesRouter.post('/:username/follow', auth.required, addFollowUser);
|
|
profilesRouter.delete('/:username/follow', auth.required, deleteFollowUser);
|
|
|
|
module.exports = profilesRouter; |