As an answer to my question yesterday about Node.js and communication with clients, I am trying to understand how this will work.
Happening:
So, I have this site where content is updated very often . Suppose this time this content is a list of locations with temperature . (yes, meteorological service)
Now, every time a client checks a specific location, he or she goes to a URL like this: where matches the location identifier in my database. example.com/location/id id
Implementation:
On the loop server (every second or so) through all the locations in my (mySQL) database and checks the appropriate temperature. Then it stores this data in an array inside . Since temperatures can constantly change, it is important to keep an eye on the updates in the database. checktemps.jschecktemps.js
When the request is executed , it looks through the array with the record with id = id. He then responds with the appropriate temperature. example.com/location/idchecktemps.js
Question:
Plain text, html or ajax call is not relevant at the moment. I'm just wondering if I have this right? Node.js is a rather unusual thing to understand, so I'm trying to figure out if this makes sense ?
Kriem source
share