diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2021-03-22 13:24:16 -0500 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2021-03-22 13:24:16 -0500 |
commit | 4b63b00c32b767d24b114d38dab8c154d6321a7b (patch) | |
tree | 306922a0663513ff37241716d24084b6f1a985f7 /csci4131/hw5/strap012_hw5/createServer.js | |
parent | almost delete file (diff) | |
download | homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar.gz homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar.bz2 homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar.lz homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar.xz homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.tar.zst homework-4b63b00c32b767d24b114d38dab8c154d6321a7b.zip |
Start Extra credit
Diffstat (limited to 'csci4131/hw5/strap012_hw5/createServer.js')
-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 |