@coconut-packages/um-routes
v0.0.7
Published
/** * Initializes user-related API routes for the application. * * @param {Express.Application} app - The Express application instance. * @param {mongoose} mongoose - The Mongoose instance for database operations. * * Routes: * - POST /api
Downloads
18
Readme
/**
- Initializes user-related API routes for the application.
- @param {Express.Application} app - The Express application instance.
- @param {mongoose} mongoose - The Mongoose instance for database operations.
- Routes:
- POST /api/users/register : Register a new user.
- GET /api/users/passwordGenerator : Generate a secret key pair.
- POST /api/users/login : Authenticate a user and return a token.
- The following routes require authentication:
- GET /api/users/ : Retrieve all users.
- GET /api/users/get/:id : Retrieve a user by ID.
- POST /api/users/update/:id : Update user details by ID.
- POST /api/users/getUserDetails : Retrieve details of the authenticated user.
- Middleware:
- Attaches the mongoose instance to each request.
- Applies authentication middleware to protected routes. */
