Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vcolesdev/vcolesdev-fcc-timestamp-api
Microservice for retrieving timestamps in different formats. Built with NodeJS, TypeScript, and Express.
https://github.com/vcolesdev/vcolesdev-fcc-timestamp-api
backend-api date-api express microservice nodejs timestamps typescript
Last synced: 28 days ago
JSON representation
Microservice for retrieving timestamps in different formats. Built with NodeJS, TypeScript, and Express.
- Host: GitHub
- URL: https://github.com/vcolesdev/vcolesdev-fcc-timestamp-api
- Owner: vcolesdev
- Created: 2024-03-02T03:57:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-02T04:00:31.000Z (10 months ago)
- Last Synced: 2024-04-11T08:53:06.842Z (9 months ago)
- Topics: backend-api, date-api, express, microservice, nodejs, timestamps, typescript
- Language: TypeScript
- Homepage:
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vcolesdev - Timestamp Microservice
## Overview
This example is the boilerplate code for the Timestamp Microservice project. Instructions for building your project can be found at https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/timestamp-microservice
## Features
- Express.js
- Node.js## Extra Credit
- nodemon
- TypeScript, tsc### To Do
- Add a frontend form for users to input a date string and get the response from the API.
## Description
This project is a simple microservice that takes a date string as a parameter and returns a JSON object with a Unix timestamp and a UTC timestamp.
## Requirements
1. A request to `/api/:${date}?` with a valid date should return a JSON object with a unix key that is a Unix timestamp of the input date in milliseconds (as type `Number`)
2. A request to `/api/:${date}?` with a valid date should return a JSON object with a utc key that is a string of the input date in the format: `Thu, 01 Jan 1970 00:00:00 GMT`
3. A request to `/api/1451001600000` should return `{ unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }`
4. Your project can handle dates that can be successfully parsed by `new Date(date_string)`
5. If the input date string is invalid, the API returns an object having the structure `{ error : "Invalid Date" }`
6. An empty `${date}` parameter should return the current time in a JSON object with a `unix` key
7. An empty `${date}` parameter should return the current time in a JSON object with a `utc` key
## License
MIT | [email protected]