File size: 2,260 Bytes
74f2af5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Deploy Codette Proxy to Railway (FREE)

## Why You Need This

HuggingFace blocks iframe embedding with `X-Frame-Options: deny`. This proxy server:
- βœ… Strips the blocking header
- βœ… Relays requests to HF Space
- βœ… Allows iframe embedding on horizoncorelabs.studio

---

## Step 1: Deploy to Railway (2 minutes)

1. Go to **https://railway.app** and sign up (with GitHub)
2. Click **"Create New Project"** β†’ **"Deploy from GitHub Repo"**
3. Connect your `codette-clean` repo (or this branch)
4. Railway auto-detects `package.json` and deploys

**Your proxy URL will look like:**
```
https://codette-proxy-xxxxxx.railway.app
```

(Railway generates a random subdomain)

---

## Step 2: Update horizoncorelabs.studio Embed

Replace your embed code with:

```html
<iframe
  src="https://YOUR-RAILWAY-URL/spaces/Raiff1982/codette-ai"
  style="width: 100%; max-width: 740px; height: 640px; border: none; border-radius: 20px; margin: 20px auto; display: block;"
  title="Codette AI"
></iframe>
```

Replace `YOUR-RAILWAY-URL` with your actual Railway domain (without `https://`).

---

## Step 3: Test

1. Reload horizoncorelabs.studio
2. Codette widget should now load in the iframe
3. Test sending a message

---

## Alternative: Fly.io (Also Free)

If Railway doesn't work:

1. Install Fly CLI: `npm install -g @fly/cli`
2. In `codette-clean` folder: `fly launch`
3. `fly deploy`
4. Get your URL: `fly status`

Update the embed code with your Fly URL.

---

## How the Proxy Works

```
horizoncorelabs.studio
  ↓ (iframe request)
Railway Proxy (YOUR-RAILWAY-URL)
  ↓ (proxies request, strips X-Frame-Options)
HuggingFace Space (HF_SPACE_URL)
  ↓ (returns response without blocking header)
horizoncorelabs.studio
  ↓ (iframe renders successfully)
```

---

## If You Need a Custom Domain

You can add a custom domain to Railway:

1. In Railway dashboard, go to **Settings** β†’ **Domains**
2. Add `api.horizoncorelabs.studio` or similar
3. Update your embed code to use that domain

Then horizoncorelabs.studio will proxy through its own subdomain instead of Railway's.

---

## Next Steps

1. Deploy to Railway (takes ~60 seconds)
2. Copy your Railway URL
3. Update embed code on Squarespace
4. Reload and test

Let me know when you've deployed!