Skip to content

emanabdeen/API_NodeJS_Postrgres_Vercel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAPI_NodeJS_Express

This project is a web API Node.js using Express. the project uses PostgreSQL. Neon is used as cloud-host PostgreSQL provider.

Getting Started

Greeting API

Overview

The Greeting API is a simple Node.js API that serves greetings based on the time of day, language, and tone. It uses Express and Sqlite3 for database interactions. The database is pre-seeded with greetings in three languages: English, French, and Spanish, for different times of day (Morning, Afternoon, Evening), in addition to 2 types of greeting tones (Formal and Casual).

Features

  • Fetch a greeting message based on time of day,language, and tone.

  • Retrieve a list of available times of day.

  • Retrieve a list of supported languages.

  • The API is deployed on Vercel and is Live. The Base address: https://api-node-js-postrgres-vercel.vercel.app/api/Greetings or https://api-node-js-postrgres-vercel-git-master-eabdeens-projects.vercel.app/api/Greetings.

  • For using the console application with the deployed API make sure to set the Base address as follow:

 client.BaseAddress = new Uri("https://api-node-js-postrgres-vercel.vercel.app/api/Greetings/"); 

## API Endpoint

### POST **/GreetUser**
- **URL**: `https://api-node-js-postrgres-vercel-git-master-eabdeens-projects.vercel.app/api/Greetings/GreetUser`
- **Description**: Returns a greeting message based on the time of day, language and Tone.
- **Request Body**:

```json
{
  "TimeOfDay": "Morning",
  "Language": "English",
  "Tone": "Formal"
}
  • response Body:
{
  "greetingMessage": "Good Morning!"
}

GET /GetAllTimesOfDay

  • URL: https://api-node-js-postrgres-vercel-git-master-eabdeens-projects.vercel.app/api/Greetings/GetAllTimesOfDay
  • Description: Returns all Times of day
  • response Body:
[
    "Morning",
    "Afternoon",
    "Evening"
]

GET /GetSupportedLanguages

  • URL: https://api-node-js-postrgres-vercel-git-master-eabdeens-projects.vercel.app/api/Greetings/GetSupportedLanguages
  • Description: Returns all the suppoted languages
  • response Body:
[
    "English",
    "Italian",
    "Spanish"
]

Authors

This assignment is designed by student name: Eman Abdeen
Student id: 8783804 GitHub repository: https://github.com/emanabdeen/API_NodeJS_Postrgres_Vercel

Releases

No releases published

Packages

 
 
 

Contributors