mirror of
https://github.com/hanzo-apps/world.git
synced 2026-10-30 14:53:09 +00:00
The fork still wore upstream's brand throughout: "World Monitor" in 754 places of prose and metadata, WORLD MONITOR in the blog logo and footer, and a byline reading "by Someone.ceo" — another company's name signing our pages. Blog assets, OG images and post directories were named for it too, and the OpenAPI schema types carried it in every identifier. Files are renamed, references follow them, and the localStorage and slug names match. Deleted .claudedocs/sentry-triage, an AI-written summary file of the kind that belongs in LLM.md if anywhere. NOTICE and LICENSE are untouched by design. NOTICE names the upstream project, the fork point and the original author; LICENSE keeps his copyright line, which MIT requires. That is where credit belongs — not in our product's chrome.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
export const config = { runtime: 'edge' };
|
|
|
|
const RELEASES_URL = 'https://api.github.com/repos/koala73/world/releases/latest';
|
|
|
|
export default async function handler() {
|
|
try {
|
|
const res = await fetch(RELEASES_URL, {
|
|
headers: {
|
|
'Accept': 'application/vnd.github+json',
|
|
'User-Agent': 'HanzoWorld-Version-Check',
|
|
},
|
|
});
|
|
|
|
if (!res.ok) {
|
|
return new Response(JSON.stringify({ error: 'upstream' }), {
|
|
status: 502,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
});
|
|
}
|
|
|
|
const release = await res.json();
|
|
const tag = release.tag_name ?? '';
|
|
const version = tag.replace(/^v/, '');
|
|
|
|
return new Response(JSON.stringify({
|
|
version,
|
|
tag,
|
|
url: release.html_url,
|
|
prerelease: release.prerelease ?? false,
|
|
}), {
|
|
status: 200,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Cache-Control': 'public, s-maxage=300, stale-while-revalidate=60',
|
|
'Access-Control-Allow-Origin': '*',
|
|
},
|
|
});
|
|
} catch {
|
|
return new Response(JSON.stringify({ error: 'fetch_failed' }), {
|
|
status: 502,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
});
|
|
}
|
|
}
|