A simple REST API controller for retrieving GitHub repositories and branches.
The GitHub API Controller is a Spring Boot application designed to interact with the GitHub API to retrieve repositories and their branches for a given user.
- URL:
/api/github/repositories/{username}
- Method:
GET
- Description: Retrieves a list of repositories for the specified GitHub user.
- Parameters:
username
(Path Variable): The GitHub username for which repositories are to be retrieved.
- Response:
- Success Response:
- Status Code:
200 OK
- Content: An array of repository objects containing information about each repository and its branches.
- Status Code:
- Error Responses:
- Status Code:
404 Not Found
- Content:
{ "status": 404, "message": "User not found" }
- Content:
- Status Code:
429 Too Many Requests
- Content:
{ "status": 429, "message": "API rate limit exceeded" }
- Content:
- Status Code:
500 Internal Server Error
- Content:
{ "status": 500, "message": "An unexpected error occurred" }
- Content:
- Status Code:
- Success Response:
To use this project, you need to deploy it to a server that supports Spring Boot applications. Once deployed, you can make requests to the defined endpoints to retrieve GitHub repository information.
To install and run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/PWilkosz99/github-api.git
- Navigate to the project directory:
cd github-api
- Build the project using Gradle:
./gradlew build
- Run the application:
./gradlew bootRun
- The application should now be running locally on port 8080.