D
D
Daniel Newman2015-03-27 00:32:18
MongoDB
Daniel Newman, 2015-03-27 00:32:18

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

2 answer(s)
R
rumkin, 2015-03-27
@danielnewman

Search separately:

  • Sample applications on Sails.js is a classic MVC framework.
  • Grabbers, but you are unlikely to find them. In Sails, you can create a service with a queue of jobs that will run indefinitely (until the process dies, for example).

K
Konstantin Kitmanov, 2015-03-27
@k12th

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 question

Ask a Question

731 491 924 answers to any question