HNG Stage 0 Backend Task
A simple REST API that returns basic information including email, current datetime, and GitHub repository URL.
Description
This API is built using Node.js and TypeScript, providing a single endpoint that returns specific information in JSON format. The API handles CORS and returns the response with appropriate HTTP status codes.
API Documentation
Base URL
When running locally: http://localhost:3000
Endpoints
GET /
Returns basic information including email, current datetime, and GitHub repository URL.
Response Format:
{
"email": "oyerohabib@yahoo.com",
"current_datetime": "2023-09-08T12:34:56Z",
"github_url": "https://github.com/oyerohabib/hng-12-BE-stage-0"
}Status Codes:
- 200: Successful response
- 500: Server error
Setup Instructions
Prerequisites
- Node.js (v14 or higher)
- npm or yarn
Local Development
- Clone the repository:
git clone https://github.com/oyerohabib/hng-12-BE-stage-0.git
cd hng-12-BE-stage-0- Install dependencies:
npm install- Start the development server:
npm run dev- Build for production:
npm run build- Start production server:
npm startThe server will start on port 3000 by default. You can modify this by setting the PORT environment variable.
Technologies Used
- Node.js
- TypeScript
- Express.js
- CORS
Related Resources
License
This project is licensed under the ISC License.
On this page
Contributors
Created January 29, 2025
Updated May 21, 2025