forked from hoangsonww/DocuThinker-AI-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
38 lines (33 loc) · 996 Bytes
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const nextConfig = {
reactStrictMode: true, // Strict mode for catching potential problems in React
// Environment variables
env: {
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
BASE_URL: process.env.BASE_URL,
HUGGINGFACE_API_KEY: process.env.HUGGINGFACE_API_KEY,
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
},
// Custom headers for API routes, including CORS settings
async headers() {
return [
{
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,POST,OPTIONS" },
],
},
];
},
// Enable image domains if needed for external image sources
images: {
domains: ["example.com"],
},
// Optional: Custom Webpack configuration
webpack(config) {
// Modify the Webpack config if needed
return config;
},
};
export default nextConfig;