https://github.com/devsdenepal/api-osp
https://github.com/devsdenepal/api-osp
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/devsdenepal/api-osp
- Owner: devsdenepal
- License: mit
- Created: 2024-10-16T09:20:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-16T10:23:58.000Z (over 1 year ago)
- Last Synced: 2024-10-18T07:07:57.873Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://apiosp.vercel.app/repos
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Source GitHub Repos API
## Overview
This project provides a simple RESTful API built with Node.js and Express that serves a list of open-source GitHub repositories, along with their respective links and star counts. The API fetches data directly from GitHub's API and includes custom repositories specified in the configuration.
## Features
- Fetch a list of open-source repositories from GitHub.
- Sort repositories based on the number of stars and forks.
- Simple REST API structure for easy integration.
## Getting Started
### Prerequisites
- Node.js (>=14.x)
- npm (Node package manager)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/devsdenepal/api-osp.git
cd devsdenepal/api-osp
```
2. Install the required dependencies:
```bash
npm install
```
### Configuration
- Ensure your custom repositories are defined in `repos.js`. Add or modify repositories as needed.
### Running the API
To start the server, run:
```bash
node index.js
```
The API will be available at `https://apiosp.vercel.app/repos`.
### Example Request
You can use a tool like Postman or curl to test the API:
```bash
curl https://apiosp.vercel.app/repos
```
### Response Format
The API returns a JSON array of repositories, each containing:
- `name`: The name of the repository.
- `url`: The GitHub link to the repository.
- `stars`: The number of stars the repository has received.
- `forks`: The number of forks of the repository.
Example Response:
```json
[
{
"name": "React",
"url": "https://github.com/facebook/react",
"stars": 195000,
"forks": 39200
},
{
"name": "Bootstrap",
"url": "https://github.com/twbs/bootstrap",
"stars": 164000,
"forks": 77900
}
]
```
## Contributing
Contributions are welcome! If you would like to contribute, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Commit your changes.
4. Push to the branch and submit a pull request.