@@ -3,27 +3,22 @@ import { withAuth } from "@lib/api-utils"
33
44const appServerUrl =
55 process . env . NEXT_PUBLIC_ENVIRONMENT === "selfhost"
6- ? process . env . INTERNAL_APP_SERVER_URL
6+ ? "http://localhost:8000"
77 : process . env . NEXT_PUBLIC_APP_SERVER_URL
88
9- // GET handler to fetch the current Supermemory MCP URL
9+ // GET handler to fetch the current Memory MCP URL
1010export const GET = withAuth ( async function GET ( request , { authHeader } ) {
1111 try {
12- const response = await fetch (
13- `${ appServerUrl } /api/settings/supermemory` ,
14- {
15- // Ensure GET is used for fetching data
16- method : "GET" ,
17- headers : { "Content-Type" : "application/json" , ...authHeader }
18- }
19- )
12+ const response = await fetch ( `${ appServerUrl } /api/settings/memory` , {
13+ // Ensure GET is used for fetching data
14+ method : "GET" ,
15+ headers : { "Content-Type" : "application/json" , ...authHeader }
16+ } )
2017
2118 const data = await response . json ( )
2219 if ( ! response . ok ) {
2320 throw new Error (
24- data . detail ||
25- data . error ||
26- "Failed to fetch Supermemory settings"
21+ data . detail || data . error || "Failed to fetch Memory settings"
2722 )
2823 }
2924 return NextResponse . json ( data )
@@ -33,13 +28,13 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
3328 }
3429} )
3530
36- // POST handler to save the Supermemory MCP URL
31+ // POST handler to save the Memory MCP URL
3732export const POST = withAuth ( async function POST ( request , { authHeader } ) {
3833 try {
3934 const body = await request . json ( ) // { mcp_url: "..." }
4035 const backendResponse = await fetch (
4136 // Renamed to avoid conflict with API response
42- `${ appServerUrl } /api/settings/supermemory ` ,
37+ `${ appServerUrl } /api/settings/memory ` ,
4338 {
4439 method : "POST" ,
4540 headers : { "Content-Type" : "application/json" , ...authHeader } ,
@@ -50,9 +45,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
5045 const data = await backendResponse . json ( )
5146 if ( ! backendResponse . ok ) {
5247 throw new Error (
53- data . detail ||
54- data . error ||
55- "Failed to save Supermemory settings"
48+ data . detail || data . error || "Failed to save Memory settings"
5649 )
5750 }
5851 return NextResponse . json ( data ) // Return the backend's response directly
0 commit comments