Refactor error handling and localDb structure, and fix usage tracking bug.
This commit is contained in:
@@ -120,6 +120,7 @@ export async function POST(request) {
|
||||
// Merge new env with existing settings
|
||||
const newSettings = {
|
||||
...currentSettings,
|
||||
hasCompletedOnboarding: true,
|
||||
env: {
|
||||
...(currentSettings.env || {}),
|
||||
...env,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getTunnelStatus, getTailscaleStatus } from "@/lib/tunnel/tunnelManager";
|
||||
import { getDownloadStatus } from "@/lib/tunnel/cloudflared";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const [tunnel, tailscale] = await Promise.all([getTunnelStatus(), getTailscaleStatus()]);
|
||||
return NextResponse.json({ tunnel, tailscale });
|
||||
const download = getDownloadStatus();
|
||||
return NextResponse.json({ tunnel, tailscale, download });
|
||||
} catch (error) {
|
||||
console.error("Tunnel status error:", error);
|
||||
return NextResponse.json({ error: error.message }, { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user