FreeCodeCamp API Backend Project: Timestamp microservice timestamp-microservice-absk
Get unix and natural timestamp.
Challenge: https://www.freecodecamp.com/challenges/timestamp-microservice
- I can pass a string as a parameter, and it will check to see whether that string contains either a unix timestamp or a natural language date (example: January 1, 2016). — DONE
https://timestamp-microservice-absk.glitch.me/api/ts/January 1, 2016{ "unix": 1451606400, "natural": "January 01, 2016" }
- If it does, it returns both the Unix timestamp and the natural language form of that date. — DONE
https://timestamp-microservice-absk.glitch.me/api/ts/1451606400{ "unix": 1451606400, "natural": "January 01, 2016" }
- If it does not contain a date or Unix timestamp, it returns null for those properties. — DONE
https://timestamp-microservice-absk.glitch.me/api/ts/random{ "unix": null, "natural": null }
- If url is
/api/ts
without any timestamp, then respond with the current time. — DONE
https://timestamp-microservice-absk.glitch.me/api/ts{ "unix": 1523406140, "natural": "April 11, 2018" }
API_HOST: timestamp-microservice-absk.glitch.me
API_VERSION: v1
API_ROOT: /api
OUTPUT
{
"unix": <time in seconds> e.g. 1492905600 or null
"natural": "Month Day, Year" e.g. "April 23, 2017" or null
}
https://timestamp-microservice-absk.glitch.me/api
GET /timestamp
GET /ts
https://timestamp-microservice-absk.glitch.me/api/timestamp/:timestring
https://timestamp-microservice-absk.glitch.me/api/ts/:timestring
:timestring
- Unix timestamp or natural time
e.g.Jan 1, 2050
,28th February 1995
,1448928000
, etc.
https://timestamp-microservice-absk.glitch.me/api/ts/1448928000
- Support for relative time
/ts/{now,latest,today,yesterday,a year ago, etc}
. - Frontend of the API timeserver for easy getting the time.
- Have a great design of the frontend.
- If url is
/api
, then repond with a JSON document with anerror
and adocumention_url
field directing to the relevant documentation of the timeserver. - Add authentication and limit based on the authenticated user priviledges