refactor: restructure API routes from v1/v2/v3 to domain-based (skydive/cms/herowars)

This commit is contained in:
2026-04-24 00:47:58 +02:00
parent b99842f458
commit 9f73ed07ba
36 changed files with 2416 additions and 50 deletions
+12
View File
@@ -0,0 +1,12 @@
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;