0.2 在线版本打通
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getMnoteRuntimeConfig } from "@/lib/runtime-config";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
const backendUrl = process.env.BACKEND_URL ?? process.env.NEXT_PUBLIC_BACKEND_URL;
|
||||
// 说明:浏览器端需要走公网(FRP),但 Next 服务端在本机时应优先走内网/本机(HTTP),
|
||||
// 否则会遇到 FRP Auto HTTPS 的自签证书导致 Node fetch 失败。
|
||||
const cfg = getMnoteRuntimeConfig();
|
||||
const backendUrl =
|
||||
process.env.BACKEND_INTERNAL_URL || process.env.BACKEND_URL || cfg.backendUrl;
|
||||
if (!backendUrl) {
|
||||
return NextResponse.json({ status: "disabled" }, { status: 200 });
|
||||
}
|
||||
@@ -22,4 +27,3 @@ export async function GET() {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user