DEV Community

Cover image for Github Image Hosting API with UI
Adrian Fathan
Adrian Fathan

Posted on

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.

Top comments (0)