Use local git port when available for git URL

This commit is contained in:
Chris Wanstrath 2026-03-03 17:10:36 -08:00
parent abdfaf8402
commit 93d913f278

View File

@ -8,7 +8,11 @@ import { Hype } from '@because/hype'
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs' import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs'
import { dirname, join } from 'path' import { dirname, join } from 'path'
const gitUrl = (name: string) => `${buildAppUrl('git', TOES_URL)}/${name}` function gitUrl(name: string): string {
const git = allApps().find(a => a.name === 'git')
if (git?.port) return `http://localhost:${git.port}/${name}`
return `${buildAppUrl('git', TOES_URL)}/${name}`
}
const router = Hype.router() const router = Hype.router()