I just finished the first API project for the backend certificate, but I’m not actually sure I did it correctly. The requirements seem pretty straight forward, but I just want to be sure. Could someone just take a quick look at my project and confirm that it does what it’s supposed to do?
p.s.
I added the top heading and input box just because I wanted to include something slightly different, and to go a little beyond the requirements. I know the top portion is irrelevant to the user stories.
The goal is to provide a json object as a response {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"}, for example, so that a user who requests it by going to your endpoint [project_url]/api/timestamp/:date_string? can get it and use it according to their needs. They may be building an app and want to use that response, which means they’ll have to write some code on their end which extracts the relevant data from the json object served up as a response by you.
If I can’t go to https://glory-amount.glitch.me/api/timestamp/2015-12-25 and get a response like the example output given on your project page ({"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"}), your service isn’t working.
@willjw3 Thanks for pointing out that error in my code! I think I got focused on adding my own feature that I forgot to re-test the original requirements. The errors should be fixed now: https://glory-amount.glitch.me/
And thank you for clarifying the project requirements. The real-world use case is now clear to me.
One thing to keep in mind, though, is that, even though your code works, when making a service for use by, say, a front-end developer who wants to go to your endpoint and get the response you’ve offered, you should also be careful about the documentation. Specifically, write up instructions that are tailored for someone who just knows how to make an API call and isn’t concerned with what your code looks like under the surface. For example, GET [project url]/api/timestamp/2015-12-25 probably doesn’t need to include the GET part in the documentation; they may or may not know what that means and it might confuse them. Just give them exactly what they need to use your service.
So your placeholder text shows yyy/mm/dd and I exactly followed that but my thinking was that I didn’t need to enter ‘1956’ I only needed to enter ‘956’ and it would assume the digit one in front. Naturally, it didn’t. Fix your placeholder since 956/01/01 is very different from 1956/01/01