I have a REST API server with Express, connects to MongoDB. Basically my app accept an input form to save some reports daily and of course the timestamp has to be that current time.
My question is, should I use Date.now() when creating the Request body (in the client-side) or should I use it on my server controller (server-side)?
In the second option, I could use the { default : Date.now() } on the model schema or inside model constructor in controller file.
Regardless what option I go with, the difference of the timestamp depends on how long it took to process the request. The body consists bit of data, mostly strings and number and does not exceed 100kb.
I'm curious how is people approach to this kind of problem