This project is a proof of concept for using a GitHub repository as an image hosting service. The API allows users to upload, list, and delete image files from the repository, providing an easy interface to manage files hosted on GitHub.
Github : MasFana/Github-Image-Bucket-API
Installation
To set up and run this project, you need Node.js and npm installed on your system.
-
Clone the repository:
git clone https://github.com/MasFana/Github-Image-Bucket-API cd Github-Image-Bucket-API
-
Install dependencies:
npm install
-
Set up environment variables by creating a
.env
file in the root directory with the following values:
GITHUB_TOKEN=<your_github_token> GITHUB_REPO=<your_github_repo> GITHUB_BRANCH=<your_github_branch>
-
Start the server:
npm start
The server will run on http://localhost:3000
.
Environment Variables
The API requires the following environment variables to be set:
-
GITHUB_TOKEN
: GitHub Personal Access Token for authentication. -
GITHUB_REPO
: GitHub repository name in the formatowner/repository
. -
GITHUB_BRANCH
: GitHub branch name where files will be uploaded.
Top comments (0)