Files
khoj/src/interface/web/next.config.mjs
Debanjum Singh Solanky 2e165a0e0a Create client API keys section on settings page
- Add table shadcn component to use in API keys settings section
- In dev mode, route requests to auth to khoj server at localhost:42110
2024-07-30 15:25:14 +05:30

52 lines
1.3 KiB
JavaScript

/** @type {import('next').NextConfig} */
const isProd = process.env.NEXT_PUBLIC_ENV === 'production';
const nextConfig = {
output: isProd ? 'export' : undefined,
rewrites: isProd ? undefined : async () => {
return [
{
source: '/api/:path*',
destination: 'http://localhost:42110/api/:path*',
},
{
source: '/auth/:path*',
destination: 'http://localhost:42110/auth/:path*',
},
];
},
trailingSlash: true,
skipTrailingSlashRedirect: true,
distDir: 'out',
images: {
loader: isProd ? 'custom' : 'default',
loaderFile: isProd ? './image-loader.ts' : undefined,
remotePatterns: isProd ? [
{
protocol: "https",
hostname: "**.googleusercontent.com",
},
{
protocol: "https",
hostname: "generated.khoj.dev",
},
{
protocol: "https",
hostname: "assets.khoj.dev",
},
] : [
{
protocol: "https",
hostname: "*"
},
{
protocol: "http",
hostname: "*"
}
]
}
};
export default nextConfig;