Recruitment task , REST API to get user repos from github
This repository has been archived on 2024-03-24. You can view files and clone it, but cannot push or open issues/pull-requests.
Go to file
Mateusz Słodkowicz 94d617ba04
Move most code from controller to service
2024-03-11 15:01:21 +01:00
gradle/wrapper Init commit 2024-02-18 12:35:17 +01:00
src Move most code from controller to service 2024-03-11 15:01:21 +01:00
.gitignore Init commit 2024-02-18 12:35:17 +01:00
README.md Init commit 2024-02-18 12:35:17 +01:00
build.gradle Init commit 2024-02-18 12:35:17 +01:00
gradlew Init commit 2024-02-18 12:35:17 +01:00
gradlew.bat Init commit 2024-02-18 12:35:17 +01:00
settings.gradle Init commit 2024-02-18 12:35:17 +01:00

README.md

GHRepo

Description

Recruitment task. REST API application that retrieves a user's repositories and their branches, returning only those that are not forks.

Build

Needs Java 21 and Gradle 8.5 To build clone and run

./gradlew build

Usage

Program needs to get request with appropriate header application/json to enpoint /{username} For example with curl

curl -H "Accept: application/json" http://127.0.0.1:8080/materusPL

Program will return list of repositories and their branches in format:

[{ 
   "name":"", //Repository name
   "owner":"", //Owner name
   "branches": [{"name":"", "sha":"" }] //List of branches with their name and last commit sha
}]

On error it will return json in format:

{
   "message":"",
   "status":""
}