Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shuddha2021/timezoneadjusterapi
Timezone API: A Node.js Express application offering a RESTful API endpoint (GET /time) for retrieving current UTC time and optional timezone-adjusted time. Built with Node.js, Express, and Moment Timezone.
https://github.com/shuddha2021/timezoneadjusterapi
ci continuous-deployment express-js javascript momentjs nodejs restful-api timezone utc web-development
Last synced: 6 days ago
JSON representation
Timezone API: A Node.js Express application offering a RESTful API endpoint (GET /time) for retrieving current UTC time and optional timezone-adjusted time. Built with Node.js, Express, and Moment Timezone.
- Host: GitHub
- URL: https://github.com/shuddha2021/timezoneadjusterapi
- Owner: shuddha2021
- Created: 2024-05-10T20:43:09.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-10T21:06:47.000Z (8 months ago)
- Last Synced: 2024-11-06T19:50:21.210Z (about 2 months ago)
- Topics: ci, continuous-deployment, express-js, javascript, momentjs, nodejs, restful-api, timezone, utc, web-development
- Language: JavaScript
- Homepage:
- Size: 6.77 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Timezone API
## Overview
This repository contains a Node.js Express application that provides a RESTful API with a single endpoint, `GET /time`. This endpoint returns the current date and time in UTC format and, optionally, the adjusted time for a specified timezone.## Features
- **Current Time**: Returns the current UTC time.
- **Timezone Adjustment**: Optionally accepts a `timezone` query parameter to return the time adjusted to the specified timezone.## Getting Started
### Prerequisites
- Node.js (Recommended version: 16.x or higher)
- npm (Node Package Manager)### Installation
1. Clone the repository:
```sh
git clone https://github.com/shuddha2021/test-dwella-2.git
Navigate to the project directory:
cd test-dwella-2Install the dependencies:
npm install### Running the Application
To start the server, run the following command:npm start
The server will start running on http://localhost:3000.
### Using the API
To get the current UTC time:curl http://localhost:3000/time
To get the time adjusted to a specific timezone (e.g., America/New_York):
curl http://localhost:3000/time?timezone=America/New_York
### Testing
To run the automated tests for the API, execute:npm test
### Continuous Integration
This project uses GitHub Actions for continuous integration. Upon each push or pull request, the tests are automatically run to ensure code quality and functionality.### Deployment
The application can be deployed to cloud platforms like Vercel or Heroku. The main branch is production-ready and can be used for deployments.### License
This project is licensed under the ISC License - see the LICENSE file for details.### Author
Shuddha Chowdhury - shuddha2021### Acknowledgements
- Node.js community
- Express.js team
- Moment Timezone contributors