Answer the question
In order to leave comments, you need to log in
How to make REST Api convenient in writing and further support?
Good time of the day. Point me in the right direction if I'm off course :) I want to write a rest service but for a large number of functions. Now I'm thinking of writing everything in router api.js which will be responsible for the todo module, calendar and so on. And then I began to doubt whether it is right to shove everything into one route, or is it better to divide it into apitodo apical and so on. Thanks in advance for your replies
Answer the question
In order to leave comments, you need to log in
It is worth highlighting all the routes in a separate folder and breaking them into files. To access data, you need to write some kind of wrapper so that changing the database or schema does not affect the operation of the API. Always google "best practices", usually people share their experiences with others and this can be used to avoid doing bad things :)
Here's an example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question