Github Image Hosting API with UI

adrian_fathan

Adrian Fathan

Posted on November 25, 2024

Github Image Hosting API with UI

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.

  1. Clone the repository:

    git clone https://github.com/MasFana/Github-Image-Bucket-API
    cd Github-Image-Bucket-API
    
    
  2. Install dependencies:

    npm install
    
    
  3. 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>
    
    
  4. 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 format owner/repository.
  • GITHUB_BRANCH: GitHub branch name where files will be uploaded.

💖 💪 🙅 🚩
adrian_fathan
Adrian Fathan

Posted on November 25, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Github Image Hosting API with UI
webdev Github Image Hosting API with UI

November 25, 2024