8000 GitHub - rusenaite/EmployeesApi
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rusenaite/EmployeesApi

Repository files navigation

Employee API tutorial

  1. Download & install docker
  2. Turn on Docker Desktop
  3. Copy source code from this repository to Your computer (Code -> Download ZIP -> Extract files)
  4. Open the downloaded folder (with .sln and docker-compose.yml files)
  5. In this folder, open preferred terminal (bash, cmd, PowerShell, etc.)
  6. Run docker-compose up
  7. Wait until employeeapi container appears and starts up
  8. For UI, in your browser, navigate to http://localhost:5000/swagger/index.html. Endpoints are listed below.
  9. With Swagger UI, you should see Employee API

Demo

Employees

GET URI (get all employees)
http://localhost:5000/api/employees
GET URI (get employees by ID)
http://localhost:5000/api/employees/0b9dfe0a-8628-426a-a802-dc162331f1f6
POST URI & request body example in JSON (add new employee)
http://localhost:5000/api/employees
{
  "firstName": "New",
  "lastName": "Employee",
  "birthDate": "2000-03-22T05:14:25.624Z",
  "homeAddress": "string",
  "currentSalary": 1000,
  "positionName": "QA"
}
PUT URI & request body example in JSON (update existing employee)
{
  "homeAddress": "Some address 123",
  "currentSalary": 990,
  "positionName": ProductOwner
}
DELETE URI (delete employee by ID)
http://localhost:5000/api/employees/f89b1b94-58dd-492a-bdb7-f9ceff13810f

Roles

GET URI (get all roles)
http://localhost:5000/api/roles
POST URI & request body example in JSON (add new role)
http://localhost:5000/api/roles
{
  "position": "InformationAnalist",
  "description": "Writes user stories for developers.",
  "hoursPerWeek": 30
}
PUT URI & request body example in JSON (update role by ID)
http://localhost:5000/api/roles/598266ed-e6ad-4c0b-baaa-2b456fd0173c
{
  "position": "QA",
  "description": "Writes Web API tests and UI tests.",
  "hoursPerWeek": 30
}
DELETE URI (delete role by ID)
http://localhost:5000/api/roles/598266ed-e6ad-4c0b-baaa-2b456fd0173c

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0