ambiere / datestamp

Simple timestamp microservice API for managing time-related operations. Built with Node.js & Express.

Home Page:https://datestamp.fly.dev/v0/api/datestamp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

datestamp

A simple Timestamp Microservice built using Express and Node.js that generates Unix and UTC timestamps for provided dates.

js-standard-style   Test   Deployment  

Features

  1. Unix Timestamp: Provides the Unix timestamp for a given date.
  2. UTC Timestamp: Returns the UTC representation of the provided date.
  3. HTTP Request Handling: Accepts HTTP requests with a date parameter and responds with timestamp information.

Usage locally

1.0 Installation:

git clone https://github.com/zhid0399123/datestamp.git
cd datestamp
pnpm install

2.0 Start the Server:

npm start

The server runs on http://0.0.0.0:3000/v0/api/datestamp by default. You can modify the port in your .env file

3.0 Endpoint:

Send a GET request to:

http://0.0.0.0:3000/v0/api/datestamp/:date_string

Replace :date_string in the URL with the date to convert (e.g., 2023-11-26, 1637894400 for Unix timestamp).

Example:

curl http://0.0.0.0:3000/v0/api/datestamp/2023-11-26

Response:

{
  "unix": 1679942400,
  "utc": "Sun, 26 Nov 2023 00:00:00 GMT"
}

Deployment

The datestamp Microservice is deployed and accessible via fly.io, allowing users to interact with the API endpoints. Follow these steps to access the deployed API:

  1. Base URL: The deployed API can be accessed at https://datestamp.fly.dev/v0/api/datestamp.

  2. Usage Examples: Here's an example using cURL to convert a timestamp to Unix time:

curl -X GET https://datestamp.fly.dev/v0/api/datestamp/1627804800000

API Endpoints

GET /v0/api/datestamp/:date_string Retrieves Unix and UTC timestamps for the provided date.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests. Please refer to the Contributing Guidelines to get started.

License

This project is licensed under the MIT License. Refer to the LICENSE file for more details.

About

Simple timestamp microservice API for managing time-related operations. Built with Node.js & Express.

https://datestamp.fly.dev/v0/api/datestamp

License:MIT License


Languages

Language:JavaScript 70.5%Language:CSS 13.6%Language:HTML 11.4%Language:Dockerfile 3.8%Language:Shell 0.7%