diff options
Diffstat (limited to '')
-rwxr-xr-x | csci4131/hw5/strap012_hw5/createServer.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/csci4131/hw5/strap012_hw5/createServer.js b/csci4131/hw5/strap012_hw5/createServer.js index bd25de5..9c108cd 100755 --- a/csci4131/hw5/strap012_hw5/createServer.js +++ b/csci4131/hw5/strap012_hw5/createServer.js @@ -78,14 +78,13 @@ function POST(req, res) { jsonO["email"] = postObj.email; jsonO["website_name"] = postObj.website_name; jsonO["website_url"] = postObj.website_url; - let read = fs.readFile('./contacts.json', 'utf8', function(err, data) { + fs.readFile('./contacts.json', 'utf8', function(err, data) { var file = JSON.parse(data); file.contacts.push(jsonO); var string = JSON.stringify(file); fs.writeFile('./contacts.json', string, function(err, data) { console.log(string); - }); - }); - - }); + }); //Write clojure + }); //Read clojure + }); //req clojure }
\ No newline at end of file |