diff --git a/README.md b/README.md index 01e6306..d539e5e 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,2 @@ -# API Project: Timestamp Microservice for FCC - -### User stories: - -[![Run on Repl.it](https://repl.it/badge/github/freeCodeCamp/boilerplate-project-timestamp)](https://repl.it/github/freeCodeCamp/boilerplate-project-timestamp) - -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. -3. If the date string is **empty** it should be equivalent to trigger `new Date()`, i.e. the service uses the current timestamp. -4. If the date string is **valid** the api returns a JSON having the structure -`{"unix": , "utc" : }` -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" }`. - -#### Example usage: -* https://Timestamp-Microservice--freecodecamp.repl.co/api/timestamp/2015-12-25 -*https://Timestamp-Microservice--freecodecamp.repl.co/api/timestamp/1451001600000 - -#### Example output: -* {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"} \ No newline at end of file +# [Timestamp Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/timestamp-microservice) diff --git a/public/style.css b/public/style.css index c8ba7d9..7e57a51 100644 --- a/public/style.css +++ b/public/style.css @@ -18,25 +18,21 @@ h3 { margin-top: 30px; } +hr { + margin: 25px; +} + .footer { margin-top: 40px; } -.user-stories { - position: relative; - text-align: justify; - max-width: 700px; - margin: 15px auto; -} code { font-family: monospace; padding: 2px; color: black; background-color: #fff; } -ol { - list-style-position: outside; -} + ul { list-style-type: none; } @@ -44,9 +40,6 @@ ul { li { margin-bottom: 0.5em; } -.user-stories li { - margin-bottom: 1em; -} a { color: #2574A9; diff --git a/views/index.html b/views/index.html index c4852a5..adfdc17 100644 --- a/views/index.html +++ b/views/index.html @@ -1,49 +1,32 @@ - - Timestamp Microservice - + Timestamp Microservice | freeCodeCamp.org + +

Timestamp Microservice

+
+
+

Example Usage:

+ -
-

API Project: Timestamp Microservice

-

User Stories:

-
    - -
  1. The API endpoint is GET [project_url]/api/timestamp/:date_string?
  2. -
  3. A date string is valid if can be successfully parsed by new Date(date_string).
    - 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.
  4. -
  5. If the date string is empty it should be equivalent to trigger new Date(), i.e. the service uses the current timestamp.
  6. -
  7. If the date string is valid the api returns a JSON having the structure
    {"unix": <date.getTime()>, "utc" : <date.toUTCString()> }
    - e.g. {"unix": 1479663089000 ,"utc": "Sun, 20 Nov 2016 17:31:29 GMT"}
  8. -
  9. If the date string is invalid the api returns a JSON having the structure
    - {"error" : "Invalid Date" }. -
  10. -
- -

Example Usage:

- - -

Example Output:

-

- {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"} -

-
- - - +

Example Output:

+

+ {"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"} +

+
+ +