Updated response to check if there needs to be [] added to ensure JSON validity
This commit is contained in:
parent
3edb0d4548
commit
88dca3688e
1 changed files with 8 additions and 1 deletions
|
@ -102,8 +102,15 @@ http.createServer(function(request, response)
|
||||||
value = '';
|
value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload = payload.replace('{{', '[{').replace('}}', '}]');
|
||||||
|
|
||||||
response.end(payload.replace('{{', '[{').replace('}}', '}]'));
|
if (payload.charAt(0) != '[')
|
||||||
|
{
|
||||||
|
payload = '[' + payload + ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
response.end(payload + '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue