Skip to content

xsunyerb/hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello World API

This API uses .NET 7 SDK

Endpoints

PUT /hello/username

Description: Saves/updates the given user’s name and date of birth in the database
Request: PUT /hello/username { “dateOfBirth”: “YYYY-MM-DD” }
Response: 204 No Content

username must contain only letters.
YYYY-MM-DD must be a date before the today date.

GET /hello/username

Description: Returns hello birthday message for the given user
Request: Get /hello/username
Response: 200 OK

Response Examples:
A. If username’s birthday is in N days:

{ 
    “message”: “Hello, <username>! Your birthday is in N day(s)”
}

B. If username’s birthday is today:

{ 
    “message”: “Hello, <username>! Happy birthday!” 
}

Deployment

Github action file in /.gthub/workflows folder.

Run

Execute locally with dotnet cli

cd ./src
dotnet run --project HelloWorldApi --urls http://localhost:5000

Execute locally with docker

Build image

cd ./src/HelloWorldApi
docker build -t hello-world-api .

Start server

docker run -p 5000:5000 hello-world-api 

Tests

  • Unit tests execution
dotnet test
  • For Postman tests, use the collection file in "/postman" folder.

About

Hello World API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published