This Node.js Express application serves as an API to fetch pinned repositories from GitHub, designed specifically for integration with a portfolio website. By using this API, you can dynamically display your GitHub pinned repositories on your portfolio site, keeping it up-to-date with your latest projects.
-
Clone the repository:
git clone https://github.com/deepsingh132/portfolio-api.git
-
Navigate to the project directory:
cd portfolio-api
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your GitHub access token:GITHUB_ACCESS_TOKEN=your-github-access-token
Note: Ensure your GitHub access token has the
repo
scope. -
Start the server:
npm start
Once the server is running, you can make HTTP requests to the specified endpoints to retrieve your pinned repositories.
-
Endpoint:
/api/v1/github/pinned-repos
-
Method:
GET
-
Description: Fetches the pinned repositories from the authenticated user's GitHub account.
-
Example Request:
curl http://localhost:5000/api/v1/github/pinned-repos
-
Example Response:
{ "repos": [ { "name": "project-1", "description": "A brief description of project 1.", "url": "https://github.com/your-username/project-1" }, { "name": "project-2", "description": "A brief description of project 2.", "url": "https://github.com/your-username/project-2" }, // ... ] }
You can customize the application by modifying the following parameters in the .env
file:
GITHUB_ACCESS_TOKEN
: Your GitHub access token.
If you would like to contribute to the project, please open an issue or submit a pull request.
This project is licensed under the MIT License.