API Documentation
Learn how the Express.js route proxies the public GitHub API and delivers formatted JSON.
Endpoint Specification
GET
/api/user/:username
Fetches the public profile information and top 5 recent repositories for the specified GitHub user.
Route Parameters
| Parameter | Type | Description |
|---|---|---|
username |
String | The GitHub username (extracted via req.params.username). |
Live Test Links
Click any link below to test the raw JSON endpoint directly in your browser:
/api/user/octocat(GitHub mascot)/api/user/torvalds(Creator of Linux & Git)/api/user/defunkt(GitHub Co-founder)
Example JSON Response
{
"username": "octocat",
"name": "The Octocat",
"avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4",
"bio": "Building things at GitHub",
"location": "San Francisco",
"company": "@github",
"blog": "https://github.blog",
"public_repos": 8,
"followers": 15600,
"following": 9,
"profile_url": "https://github.com/octocat",
"created_at": "2011-01-25T18:44:36Z",
"recent_repos": [
{
"name": "boysenberry-repo-1",
"description": "Testing repo",
"url": "https://github.com/octocat/boysenberry-repo-1",
"stars": 420,
"forks": 15,
"language": "Ruby"
}
]
}
Key Architecture Concepts
- Serverless Ready: Zero database required. It runs as a pure fetcher/proxy on Vercel without data persistence bottlenecks.
- Express Route Parameters: Demonstrates reading dynamic URL paths using
req.params.username. - Asynchronous Fetch: Communicates with GitHub's REST API using modern
async/awaitand nativefetch().