Secure API example to send data from a device to a node/Meteor app


I am a newbie in Node/Meteor so please bare with me :slight_smile:

I have a device, an ESP8266 which needs to send its data to be stored on a server. I was wondering if you guys can advise on how can I write a secure API which prevents SQL injection and other threats and only the devices which have the API hardcoded into them can send data over the internet.

I am only sending POST requests from the devices as there is no need to delete/update or view the data.

Would really appreciate any help.

Thanks in advance.