feat:移除了弹窗,服务器添加sls

This commit is contained in:
2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 changed files with 1322534 additions and 0 deletions

View File

@ -0,0 +1,27 @@
// Netlify Function转发 changelog 目录数据。
// 客户端直连 CNB 会被 CORS 拦截CNB 只放行 docs.cnb.cool
// 由本站服务器代为拉取(服务器无 CORS 限制),每次请求实时转发。
const CNB_URL =
'https://cnb.cool/axlmc/Axolotl/-/git/raw/main/apps/website/releases/catalog.json'
export default async () => {
try {
const response = await fetch(CNB_URL, {
headers: { 'User-Agent': 'Axolotl-Website' },
signal: AbortSignal.timeout(8000),
})
if (!response.ok) {
return new Response(`CNB source returned ${response.status}`, { status: 502 })
}
return new Response(await response.text(), {
headers: {
'Content-Type': 'application/json',
// 浏览器不缓存每次访问实时请求Netlify CDN 边缘缓存 5 分钟
// 以节省 Function 调用额度;错误响应不缓存。
'Cache-Control': 'public, max-age=0, s-maxage=300',
},
})
} catch (error) {
return new Response(`Failed to fetch release catalog: ${error.message}`, { status: 502 })
}
}