Centralised/Single file for API calls in Backend
Current Situation Multiple files for routing listed below:
My suggestion
In the backend folder, there is a routes folder designed to manage API calls. A single file within this folder should be created to handle the routing. The file uses Express.js to define routes for patient signup and other functionalities. It imports the necessary controllers and middleware to handle the requests.
Here’s a brief overview of the file:
- Dependencies: Imports Express.js, Router, and a middleware (Multer).
- Controllers: Imports specific functions (
patientSignup,patientLogin,updatePatientData,validateTokenPatient) from thepatientAuthcontroller. - Routes: Defines routes for patient login and signup:
POST /patient/login: Handles patient login.POST /patient/signup: Handles patient signup.
- Export: Exports the configured router to be used in the main application.
This setup modularizes the routing logic, making the code more maintainable and scalable.
@SB2318
Please look into this
@jaickeyminj Both did the same thing, Only here Contributors named the file as userRoute instead of user
@SB2318 can I take this issue
@jaickeyminj please let me know your availability for this task.
Hi @SB2318 ,
I am available. Please describe the issue. Thanks!
Hi @SB2318 ,
I am available. Please describe the issue. Thanks!
Okay, but as you raised the issue, please describe it from yourself,
Currently, there are three Routes in the backend. (i) userRoute (ii) articleRoute (iii) specializationRoute
Now, If you have enough visualization how can you optimize those routes and controllers without losing any features You can start.
Hello @jaickeyminj! Your issue #73 has been closed. Thank you for your contribution!
evaluate this at a later time.
Hello @jaickeyminj! Your issue #73 has been closed. Thank you for your contribution!