11var express = require ( 'express' ) ;
22var app = express ( ) ;
33
4- const accountSid = 'sid ' ;
5- const authToken = 'token ' ;
4+ const accountSid = 'Account_ID ' ;
5+ const authToken = 'Auth_Token ' ;
66const client = require ( 'twilio' ) ( accountSid , authToken ) ;
77
88app . get ( '/temperature' , function ( req , res ) {
@@ -12,7 +12,7 @@ app.get('/temperature', function (req, res) {
1212
1313 client . messages
1414 . create ( {
15- body : 'Tampered! ' + req . query . temperature ,
15+ body : 'Your package was tampered at ' + req . query . location + ' and the temperature has changed to ' + req . query . temperature + ' Degree Celcius.' ,
1616 from : 'whatsapp:+14155238886' ,
1717 to : 'whatsapp:+918289940688'
1818 } )
@@ -31,7 +31,7 @@ app.get('/location', function (req, res) {
3131
3232 client . messages
3333 . create ( {
34- body : 'Location changed! ' ,
34+ body : 'Your package has arrived at ' + req . query . location + ' with temperature ' + req . query . temperature + ' Degree Celcius. ',
3535 from : 'whatsapp:+14155238886' ,
3636 to : 'whatsapp:+918289940688'
3737 } )
@@ -43,7 +43,7 @@ app.get('/location', function (req, res) {
4343} ) ;
4444
4545
46- pp . get ( '/destination' , function ( req , res ) {
46+ app . get ( '/destination' , function ( req , res ) {
4747 console . log ( 'Location Change' ) ;
4848 console . log ( req . query . temperature )
4949 console . log ( req . query . location )
0 commit comments