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.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more