reproxy

๐Ÿšš Deliver any files in the GitHub repository

MIT License

Stars
0
Committers
4

๐Ÿšš Deliver any files in the GitHub repository

๐Ÿ’ก Concepts

You can host your specific file on the GitHub repository. The usage I assume is for one-line scripts. (i.e. dotfiles or some install scripts, like curl https://example.com | sh)

If you access from browsers, you'll redirected to the GitHub page, not a raw file.

For the development or testing, you can access to the different branches or tags. To do this, simply add the ref name to the sub-directory. (i.e. curl https://example.com/ref | sh)

๐Ÿ“Š Usage

๐Ÿ’ป On Local

  1. Copy the .env.tmpl to .env and edit as you prefer

    ๐ŸŒ Environment Variables

  2. Follow the steps depending on the runtime

    • ๐Ÿฆ• Deno

      1. Run this command

        deno serve -A --env-file='.env' jsr:@5ouma/reproxy
        
    • ๐Ÿž Bun

      1. Add this code to the index.ts

        export { default } from "@5ouma/reproxy";
        
      2. Run these commands

        bunx jsr add @5ouma/reproxy
        bun run index.ts
        
    • ๐Ÿข Node.js

      1. Add this code to the index.js

        import { serve } from "@hono/node-server";
        import app from "@5ouma/reproxy";
        serve(app);
        
      2. Run these commands

        npm install @hono/node-server
        npx jsr add @5ouma/reproxy
        node run index.js
        

๐Ÿฆ• Use Deno Deploy

  1. Create a new playground

  2. Replace the default code with this

    export { default } from "jsr:@5ouma/reproxy";
    
  3. Set the environment variables (Don't forget!!)

    ๐ŸŒ Environment Variables

โ›…๏ธ Use Cloudflare Workers

  1. Set up the wrangler.toml

    ๐ŸŒ Environment Variables

  2. Add this code to the index.ts

    export { default } from "@5ouma/reproxy";
    
  3. Deploy with these commands

    npx jsr add @5ouma/reproxy
    npx wrangler deploy index.ts
    

๐Ÿ”จ Development

  1. Clone this repository

    git clone https://github.com/5ouma/reproxy.git
    
  2. Copy the .env.tmpl to .env and edit as you prefer

    ๐ŸŒ Environment Variables

  3. Run the server.ts via these task runners

    # For production
    deno task start
    
    # For development
    deno task dev
    

๐ŸŒ Environment Variables

Name Required
REPOSITORY_OWNER yes
REPOSITORY_NAME yes
REPOSITORY_PATH yes
GITHUB_TOKEN no

[!NOTE] You need to add GITHUB_TOKEN if you want to:

  • Access the file in the private repository
  • Avoid the API usage limit

๐Ÿ†˜ Help

๐ŸŽฝ Contributing

I happily welcome your contributions! Before you contribute, I would recommend reading CONTRIBUTING.md for a better development experience.

Badges
Extracted from project README
GitHub Release JSR JSR Score GitHub last commit GitHub commit activity CI Release pre-commit.ci status codecov
Related Projects