Added Cloudflare Worker Compatible Configs (#2343)

This commit is contained in:
Saket Aryan
2025-03-10 01:41:47 +05:30
committed by GitHub
parent d3911b92cf
commit e30e4967ae
8 changed files with 25 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ const useUserId = () => {
export const Assistant = () => {
const { userId, resetUserId } = useUserId();
const runtime = useChatRuntime({
api: "/api/chat",
api: "https://demo.mem0.ai/api/chat",
body: { userId },
});

View File

@@ -1,5 +1,6 @@
"use client";
import darkAssistantUi from "@/images/assistant-ui-dark.svg";
import assistantUi from "@/images/assistant-ui.svg";
import React from "react";
import Image from "next/image";
@@ -27,7 +28,7 @@ export default function ThemeAwareLogo({
}
// For default variant, use the full logo image
const logoSrc = isDarkMode ? "/images/assistant-ui-dark.svg" : "/images/assistant-ui.svg";
const logoSrc = isDarkMode ? darkAssistantUi : assistantUi;
return (
<Image

View File

@@ -1,5 +1,7 @@
"use client";
import darkLogo from "@/images/dark.svg";
import lightLogo from "@/images/light.svg";
import React from "react";
import Image from "next/image";
@@ -27,7 +29,7 @@ export default function ThemeAwareLogo({
}
// For default variant, use the full logo image
const logoSrc = isDarkMode ? "/images/dark.svg" : "/images/light.svg";
const logoSrc = isDarkMode ? darkLogo : lightLogo;
return (
<Image

View File

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 371 B

View File

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 378 B

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -2,6 +2,24 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
assetPrefix: "https://demo.mem0.ai",
images: {
path: "https://demo.mem0.ai",
},
async headers() {
return [
{
// matching all API routes
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,DELETE,PATCH,POST,PUT" },
{ key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" },
]
}
]
}
};
export default nextConfig;