Back to feed

amirshaker000/netlify-relay

amirshaker000/netlify-relay
379
+13/day
1.1k
JavaScript

From the README

šŸš€ Netlify XHTTP Relay

Simple Netlify Edge Function relay project
Created by amirs

šŸ‡®šŸ‡· Persian Guide

Persian version: README_FA.md

āš ļø Important Notice

Use this project only with your own domain/server or with permission.

✨ Features

  • Netlify Edge Function relay
  • Simple setup
  • Works with Netlify website and Netlify CLI
  • Environment variable based backend target
  • Supports target domain with port

šŸ“¦ Project Structure

.
ā”œā”€ā”€ netlify/
│   └── edge-functions/
│       └── relay.js
ā”œā”€ā”€ public/
│   └── index.html
ā”œā”€ā”€ netlify.toml
ā”œā”€ā”€ package.json
ā”œā”€ā”€ README.md
└── README_FA.md

šŸ“ Deploy by Forking This Repository

This method works, but it is not recommended for most users.
Recommended method: download/copy the project and deploy your own version.

šŸ” Required Environment Variable

You must set:

TARGET_DOMAIN=

Important

The domain must include port.

Correct examples:

Wrong examples:


example.com:443

localhost:443
127.0.0.1:443

šŸš€ Deploy with Netlify Website

Use this project directly.

1. Import project

Go to Netlify:

Then:

Add new project → Import an existing project

Select your repository.

2. Build settings

Use:

| Setting | Value | |---|---| | Build command | npm run build | | Publish directory | public |

3. Add Environment Variable

Go to:

Site configuration → Environment variables → Add variable

Add:

Key: TARGET_DOMAIN
Value: 

Example:

TARGET_DOMAIN=

4. Redeploy

After adding TARGET_DOMAIN, redeploy:

Deploys → Trigger deploy → Deploy site

šŸ“ Deploy by Forking This Repository

This method works, but it is not recommended for most users.
Recommended method: download/copy the project and deploy your own version.

Why fork is not recommended?

  • Your project stays connected to the original repository history
  • Beginners may get confused with GitHub fork/update options
  • If you want a clean personal project, copying the files is better

If you still want to use Fork

  1. Open this project on GitHub
  2. Click Fork
  3. Choose your GitHub account
  4. After fork is created, go to Netlify
  5. Click:
Add new project → Import an existing project → GitHub
  1. Select your forked repository
  2. Use these build settings:

| Setting | Value | |---|---| | Build command | npm run build | | Publish directory | public |

  1. Add environment variable:
TARGET_DOMAIN=
  1. Deploy the site

After changing TARGET_DOMAIN, always redeploy.

šŸ’» Deploy with Netlify CLI

1. Install Netlify CLI

npm install -g netlify-cli

2. Go to project folder

cd path/to/project

3. Login

netlify login

4. Link project

If your site already exists on Netlify:

netlify link

If you want CLI to create the site:

netlify init

5. S