refactor: restructure API routes from v1/v2/v3 to domain-based (skydive/cms/herowars)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const express = require('express');
|
||||
const { createClan, deleteClan, getAllClans, getClan, updateClan } = require('../../../controllers/clans.controller');
|
||||
const auth = require('../../../middlewares/auth');
|
||||
|
||||
const clanRouter = express.Router();
|
||||
|
||||
//clanRouter.param('clanId', getClan);
|
||||
clanRouter.get('/', auth.optional, getAllClans);
|
||||
clanRouter.post('/', auth.optional, createClan);
|
||||
clanRouter.get('/:clanId', auth.required, getClan);
|
||||
clanRouter.put('/:clanId', auth.required, updateClan);
|
||||
clanRouter.delete('/:clanId', auth.required, deleteClan);
|
||||
|
||||
module.exports = clanRouter;
|
||||
Reference in New Issue
Block a user