Answer the question
In order to leave comments, you need to log in
Node.js code in MVC with requests to third party APIs. Do you know an example?
I'm looking for an example of a fetcher (fetching/grabbing) for any public API with subsequent data processing/saving (mongoDB/NoSQL), decomposed according to MVC rules: Schemas - separately, controllers - separately. The presence of ExpressJS / AngularJS is not critical.
I really want to see a good code for the 3rd party API, because there is still very little public code for the API of my project (CrunchBase). Even the bad ones.
I read books, but I need a good clean code. I don't find anything.
Answer the question
In order to leave comments, you need to log in
Search separately:
I make requests to the API via cron, and the application itself simply takes it from the database.
Pros: no callback hell; there are no brakes and failures if the external API has fallen.
Cons: the data in the database is inevitably stale (how stale depends on how often the grabber is run by cron), but this is not always scary (for example, the weather forecast in the API is updated every two hours).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question