Skip to content

soumyadeeptadas/Timestamp-Microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

API Project: Timestamp Microservice

APP Link

refresh if theres loading or server error

Overview:

  1. This microservice produces the UTC as well as unix date when the endpoint is satisfied.
  2. The API endpoint is https://timestamp-microservice-sd.glitch.me/api/timestamp/:date_string?
  3. Returns current UTC and unix date if no date_string is passed.
  4. If the date string is valid the api returns a JSON, having the structure: 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:

(Returns current UTC date-time and UNIX timestamp)

(below links return for specified date-time in both formats)

Example output:

  • {"unix":1590769211006,"utc":"Fri, 29 May 2020 16:20:11 GMT"}

To run locally:

prerequisites NodeJs

  • cd into the project folder
  • in powershell or similar terminal, run 'npm install --save'
  • then run 'node server.js'
  • app starts at specified port number