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.
- Current Time: Returns the current UTC time.
- Timezone Adjustment: Optionally accepts a
timezone
query parameter to return the time adjusted to the specified timezone.
- Node.js (Recommended version: 16.x or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone https://github.com/shuddha2021/test-dwella-2.git
Navigate to the project directory: cd test-dwella-2
Install the dependencies: npm install
To start the server, run the following command:
npm start
The server will start running on http://localhost:3000.
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
To run the automated tests for the API, execute:
npm test
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.
The application can be deployed to cloud platforms like Vercel or Heroku. The main branch is production-ready and can be used for deployments.
This project is licensed under the ISC License - see the LICENSE file for details.
Shuddha Chowdhury - shuddha2021
- Node.js community
- Express.js team
- Moment Timezone contributors