Merge pull request #35 from scissorsneedfoodtoo/fix/sync-with-live-solution

fix: sync with example project
This commit is contained in:
Tom 2020-04-23 16:46:08 -05:00 committed by GitHub
commit 3d464e6d91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# API Project: Timestamp Microservice for FCC # API Project: Timestamp Microservice for FCC
### User stories : ### User stories:
1. The API endpoint is `GET [project_url]/api/timestamp/:date_string?` 1. The API endpoint is `GET [project_url]/api/timestamp/:date_string?`
2. A date string is valid if can be successfully parsed by `new Date(date_string)` (JS) . Note that the unix timestamp needs to be an **integer** (not a string) specifying **milliseconds**. In our test we will use date strings compliant with ISO-8601 (e.g. `"2016-11-20"`) because this will ensure an UTC timestamp. 2. A date string is valid if can be successfully parsed by `new Date(date_string)` (JS) . Note that the unix timestamp needs to be an **integer** (not a string) specifying **milliseconds**. In our test we will use date strings compliant with ISO-8601 (e.g. `"2016-11-20"`) because this will ensure an UTC timestamp.
@ -12,8 +12,8 @@ e.g. `{"unix": 1479663089000 ,"utc": "Sun, 20 Nov 2016 17:31:29 GMT"}`.
5. If the date string is **invalid** the api returns a JSON having the structure `{"error" : "Invalid Date" }`. 5. If the date string is **invalid** the api returns a JSON having the structure `{"error" : "Invalid Date" }`.
#### Example usage: #### Example usage:
* https://curse-arrow.hyperdev.space/api/timestamp/2015-12-15 * https://curse-arrow.glitch.me/api/timestamp/2015-12-25
* https://curse-arrow.hyperdev.space/api/timestamp/1450137600000 * https://curse-arrow.glitch.me/api/timestamp/1451001600000
#### Example output: #### Example output:
* { "unix": 1450137600, "natural": "December 15, 2015" } * {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"}

View File

@ -13,7 +13,7 @@
<div class="container"> <div class="container">
<h2>API Project: Timestamp Microservice</h2> <h2>API Project: Timestamp Microservice</h2>
<h3>User Stories :</h3> <h3>User Stories:</h3>
<ol class="user-stories"> <ol class="user-stories">
<li>The API endpoint is <code>GET [project_url]/api/timestamp/:date_string?</code></li> <li>The API endpoint is <code>GET [project_url]/api/timestamp/:date_string?</code></li>
@ -30,8 +30,8 @@
<h3>Example Usage:</h3> <h3>Example Usage:</h3>
<ul> <ul>
<li><code>GET [project url]/api/timestamp/2015-12-25</code></li> <li><a href="api/timestamp/2015-12-25">[project url]/api/timestamp/2015-12-25</a></li>
<li><code>GET [project url]/api/timestamp/1451001600000</code></li> <li><a href="api/timestamp/1451001600000">[project url]/api/timestamp/1451001600000</a></li>
</ul> </ul>
<h3>Example Output:</h3> <h3>Example Output:</h3>
@ -41,7 +41,7 @@
</div> </div>
<div class="footer"> <div class="footer">
<p> <p>
by <a href="http://www.freecodecamp.com/">freeCodeCamp</a> | <a href="https://hyperdev.com/#!/remix/FCC_API_timestamp_bplate/8338be2-a353-4892-8a0d-6295e4f12eb5">Click here to Remix</a> By <a href="https://www.freecodecamp.org/">freeCodeCamp</a>
</p> </p>
</div> </div>
</body> </body>