diff options
author | rohan09-raj <rajrohan1914@gmail.com> | 2022-08-23 15:58:38 +0530 |
---|---|---|
committer | rohan09-raj <rajrohan1914@gmail.com> | 2022-08-23 15:58:38 +0530 |
commit | 4910469bee30ffd81a3725062fb68919e6806609 (patch) | |
tree | c98257d84c443fe82ea1bb8b9b4cf046d81567a4 | |
parent | ffd2c78b86111a5d1f7914e7dab4ffc946cb5287 (diff) |
fixed user and users routes
-rw-r--r-- | server/index.js | 4 | ||||
-rw-r--r-- | server/routes/user.js | 12 | ||||
-rw-r--r-- | server/routes/users.js | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/server/index.js b/server/index.js index c19ce41..8bb5c91 100644 --- a/server/index.js +++ b/server/index.js @@ -4,7 +4,8 @@ import mongoose from 'mongoose'; import cors from 'cors'; import dotenv from 'dotenv'; -import userRoutes from './routes/users.js'; +import userRoutes from './routes/user.js'; +import usersRoutes from './routes/users.js'; import healthRoutes from './routes/health.js'; import messageRoutes from './routes/message.js'; @@ -17,6 +18,7 @@ app.use(cors()); app.use('/', healthRoutes); app.use('/user', userRoutes); +app.use('/users', usersRoutes); app.use('/', messageRoutes); const CONNECTION_URL = process.env.CONNECTION_URL; diff --git a/server/routes/user.js b/server/routes/user.js new file mode 100644 index 0000000..bbf963b --- /dev/null +++ b/server/routes/user.js @@ -0,0 +1,12 @@ +import Express from 'express'; +import users from '../controllers/users.js'; + +const router = Express.Router(); + +router.post('/', users.createUser); +router.get('/:id', users.getUser); +router.patch('/:id', users.updateUser); +router.delete('/:id', users.deleteUser); +router.get('/aadhaar/:aadhaar', users.getUserByAadhaarNumber); + +export default router; diff --git a/server/routes/users.js b/server/routes/users.js index c2a1534..bfb3ab9 100644 --- a/server/routes/users.js +++ b/server/routes/users.js @@ -3,12 +3,6 @@ import users from '../controllers/users.js'; const router = Express.Router(); -router.post('/', users.createUser); -router.get('/:id', users.getUser); -router.patch('/:id', users.updateUser); -router.delete('/:id', users.deleteUser); - -router.get('/aadhaar/:aadhaar', users.getUserByAadhaarNumber); router.get('/verified', users.getVerifiedUsers); router.get('/unverified', users.getUnverifiedUsers); router.get('/updating', users.getUpdatingUsers); |