https://github.com/g4eva-dev/backend-hng-task-0
Develop a public API that returns email address, current time and Github URL
https://github.com/g4eva-dev/backend-hng-task-0
Last synced: about 1 year ago
JSON representation
Develop a public API that returns email address, current time and Github URL
- Host: GitHub
- URL: https://github.com/g4eva-dev/backend-hng-task-0
- Owner: G4EVA-dev
- Created: 2025-01-29T17:54:48.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-29T20:21:45.000Z (over 1 year ago)
- Last Synced: 2025-02-07T18:52:04.606Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://backend-hng-task-0.onrender.com/
- Size: 709 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backend HNG Task 0
## Description
This is a simple backend API built with node.js. It provides an endpoint that returns essential details, including the developer's email, the current datetime, and a link to the project's GitHub repository. The API is lightweight and serves as an introduction to backend development.
Task from HNG, Checkout [hng.backlink](https://hng.tech/hire/nodejs-developers)
## Features
- Returns developer email.
- Provides the current datetime dynamically.
- Includes a link to the GitHub repository.
- CORS enabled for cross-origin requests.
## Tech Stack
- **Node.js** - JavaScript runtime environment.
- **Express.js** - Web framework for Node.js.
- **CORS** - Middleware to handle cross-origin resource sharing.
## Setup Instructions
### Prerequisites
Ensure you have the following installed on your machine:
- [Node.js](https://nodejs.org/) (LTS recommended)
- npm (comes with Node.js)
### Installation & Running Locally
1. Clone the repository:
```sh
git clone https://github.com/G4EVA-dev/backend-hng-task-0.git
```
2. Navigate into the project directory:
```sh
cd backend-hng-task-0
```
3. Install dependencies:
```sh
npm install
```
4. Start the server:
```sh
node index.js
```
5. The API will be available at:
```
http://localhost:3000/
```
## API Documentation
### Endpoint: GET /
#### URL:
```
https://backend-hng-task-0.onrender.com
```
#### Response Format:
- **200 OK**
- JSON response with the following structure:
```json
{
"email": "tanzeglenn@gmail.com",
"current_datetime": "2025-01-01T12:00:00.000Z",
"github_url": "https://github.com/G4EVA-dev/backend-hng-task-0"
}