1
1
var express = require ( 'express' ) ;
2
2
var app = express ( ) ;
3
3
4
- const accountSid = 'sid ' ;
5
- const authToken = 'token ' ;
4
+ const accountSid = 'Account_ID ' ;
5
+ const authToken = 'Auth_Token ' ;
6
6
const client = require ( 'twilio' ) ( accountSid , authToken ) ;
7
7
8
8
app . get ( '/temperature' , function ( req , res ) {
@@ -12,7 +12,7 @@ app.get('/temperature', function (req, res) {
12
12
13
13
client . messages
14
14
. 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.' ,
16
16
from : 'whatsapp:+14155238886' ,
17
17
to : 'whatsapp:+918289940688'
18
18
} )
@@ -31,7 +31,7 @@ app.get('/location', function (req, res) {
31
31
32
32
client . messages
33
33
. create ( {
34
- body : 'Location changed! ' ,
34
+ body : 'Your package has arrived at ' + req . query . location + ' with temperature ' + req . query . temperature + ' Degree Celcius. ',
35
35
from : 'whatsapp:+14155238886' ,
36
36
to : 'whatsapp:+918289940688'
37
37
} )
@@ -43,7 +43,7 @@ app.get('/location', function (req, res) {
43
43
} ) ;
44
44
45
45
46
- pp . get ( '/destination' , function ( req , res ) {
46
+ app . get ( '/destination' , function ( req , res ) {
47
47
console . log ( 'Location Change' ) ;
48
48
console . log ( req . query . temperature )
49
49
console . log ( req . query . location )
0 commit comments