This is done based on instructions from Challenge.txt from LogDNA.
I have adjusted some of the API calls to make it more intuitive however.
I gained a great insight into how API works and the basic fuctionality of Restify.js.
First install tools
npm install restify
npm install mongoose
This program is designed to perform the following functions.
- /time/set (POST Method) -Originially I was supposed to input id as well as UTC time in parameters. -But I thought that inputting required variables in body will be more intuitive. Following is the schema of the data object.
{
"_id"(required): Number,
"UTCTime"(required [format hh:mm:ss]): String,
"Zone"(required): String,
"CurrentTime"(not required): String
}
- /time/get/:id (GET Method) -given the value of a unique id, it searches the database and displays a document that matches with the ID
- /time/delete/:id (DELETE Method) -given the value of a unique id, it searches the database and removes a document that matches with the ID
All tests were performed with Postman.
If you have any questions please let me know via:
email: [email protected]
phone: 415-909-8188
Thank you!