No description
  • TypeScript 96.1%
  • CSS 3.2%
  • JavaScript 0.4%
  • HTML 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-04 17:09:06 +07:00
public first commit 2026-08-15 09:20:24 +07:00
scripts fix: update logic for generate config 2026-09-04 17:09:06 +07:00
src fix: update logic for generate config 2026-09-04 17:09:06 +07:00
worker fix: remove the proxy url 2026-08-15 12:17:45 +07:00
.gitignore feat: add setup script for models 2026-08-15 12:08:10 +07:00
bun.lock feat: add setup script for models 2026-08-15 12:08:10 +07:00
eslint.config.js first commit 2026-08-15 09:20:24 +07:00
index.html first commit 2026-08-15 09:20:24 +07:00
omp.cache feat: add setup script for models 2026-08-15 12:08:10 +07:00
package.json fix: update logic for generate config 2026-09-04 17:09:06 +07:00
README.md fix: remove the proxy url 2026-08-15 12:17:45 +07:00
tsconfig.app.json feat: add setup script for models 2026-08-15 12:08:10 +07:00
tsconfig.json fix: update logic for generate config 2026-09-04 17:09:06 +07:00
tsconfig.node.json first commit 2026-08-15 09:20:24 +07:00
tsconfig.scripts.json fix: update logic for generate config 2026-09-04 17:09:06 +07:00
vite.config.ts fix: remove the proxy url 2026-08-15 12:17:45 +07:00
wrangler.jsonc fix: remove the proxy url 2026-08-15 12:17:45 +07:00

9router Config Generator

Generate configuration files and one-command installers for 9router-compatible model gateways.

Local development

bun install
bun run dev

Quality checks

bun run verify

verify runs the production build, all tests, and ESLint. bun run deploy runs this validation before publishing the Worker.

Deploy to Cloudflare Workers

This project deploys a Cloudflare Worker together with the Vite dist/ assets. It is not a Cloudflare Pages project.

  1. Enable Workers for the target Cloudflare account and configure its workers.dev subdomain.

  2. Authenticate Wrangler locally, or create a least-privilege Cloudflare API token for CI with the Edit Cloudflare Workers template, restricted to the deployment account.

  3. Run:

    bun run deploy
    
  4. Open the deployed https://9router-config-generate.<your-workers-subdomain>.workers.dev URL and test both / and a generated /i/<token>.sh install link.

Optional custom domain

After the first deployment, add a hostname in Workers & Pages → 9router-config-generate → Settings → Domains & Routes → Add Custom Domain. The Cloudflare zone must be active and the chosen hostname cannot already have a CNAME record. Cloudflare creates the DNS record and TLS certificate.

Do not protect the app or /i/* with Cloudflare Access if users must download install scripts via curl or PowerShell without signing in.

Gateway CORS requirement

Models are requested directly from the Base URL entered by the user at <gateway>/models. This app does not proxy gateway requests through Cloudflare, so it works with any reachable gateway that permits cross-origin requests.

Configure each gateway to allow the deployed app origin and request headers:

Access-Control-Allow-Origin: https://<your-app-domain>
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type

For a local 9router gateway, allow the deployed app domain in its CORS configuration. Cloudflare cannot access localhost on a visitor's computer, but the visitor's browser can when the gateway permits that origin.

Cloudflare resources used

  • Cloudflare Workers
  • Workers Static Assets (ASSETS binding)
  • Optional custom domain

No KV, D1, R2, Queue, Durable Object, or Worker secret is required.