Answer the question
In order to leave comments, you need to log in
How to organize structure of Node.js API?
Node.js + Express + MongoDB. There is an admin panel, several sites (one-pagers) and a slack bot. All this business is on one server. The sites are almost the same and therefore each site has access to one common database and to its own personal database. How to do it better? Each site will have its own API that can accept POST / PUT / DELETE requests from the bot and the admin panel and change the values in its database, and the admin panel will only change the general database? Or let the admin panel directly access the database of each site and the bot will make requests to the admin API?
Answer the question
In order to leave comments, you need to log in
A miracle happened. Decided to refuse the general DB. Since in the local database the information from the general one was partially duplicated. As a result, it will be like this: each site has its own database and its own API. The bot and admin panel will send requests to the site's API and all the magic will already happen there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question