Skip to main content
Glama
next.config.tsβ€’1.39 kB
import type { NextConfig } from 'next'; import os from 'os'; // Determine allowed development origins (local network IPs on port 3000) const interfaces = os.networkInterfaces(); const allowedOrigins: string[] = ['http://localhost:3000']; Object.values(interfaces).forEach(list => list?.forEach(iface => { if (iface.family === 'IPv4' && !iface.internal) { allowedOrigins.push(`http://${iface.address}:3000`); } }) ); // const _isDev = process.env.NODE_ENV === 'development'; // Not currently used const isStandalone = process.env.BUILD_STANDALONE === 'true'; const nextConfig: NextConfig = { reactStrictMode: true, // Use standalone output for production builds ...(isStandalone && { output: 'standalone' as const }), // Disable ESLint during build to avoid config issues eslint: { ignoreDuringBuilds: true, }, // Allow static asset requests from these origins in dev mode allowedDevOrigins: allowedOrigins, async rewrites() { const apiPort = process.env.API_PORT ?? '3001'; return [ { source: '/api/:path*', destination: `http://localhost:${apiPort}/api/:path*`, // Proxy to backend }, ]; }, // Allow cross-origin requests for Next.js static and HMR assets during dev async headers() { return [ { source: '/_next/:path*', headers: [{ key: 'Access-Control-Allow-Origin', value: '*' }], }, ]; }, }; export default nextConfig;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/campfirein/cipher'

If you have feedback or need assistance with the MCP directory API, please join our Discord server