Address style fixes in app.coffee

This commit is contained in:
Praneeth Bodduluri 2015-09-16 21:05:13 +05:30 committed by Pablo Carranza Vélez
parent feb4d74d28
commit e1957def25

View File

@ -57,11 +57,10 @@ knex.init.then ->
updateIpAddr = ->
callback = (error, response, body ) ->
if !error && response.statusCode == 200
api_response = JSON.parse(body)
device.updateState(
ip_address: api_response.Status
ip_address: body.Status
)
request.get(config.gosuperAddress + '/v1/ipaddr', callback )
request.get({ url: "#{config.gosuperAddress}/v1/ipaddr", json: true }, callback )
console.log('Starting periodic check for IP addresses..')
setInterval(updateIpAddr, 30 * 1000) # Every 30s