amirshaker000/netlify-relay
amirshaker000/netlify-relayFrom 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
- Open this project on GitHub
- Click Fork
- Choose your GitHub account
- After fork is created, go to Netlify
- Click:
Add new project ā Import an existing project ā GitHub
- Select your forked repository
- Use these build settings:
| Setting | Value |
|---|---|
| Build command | npm run build |
| Publish directory | public |
- Add environment variable:
TARGET_DOMAIN=
- 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