| 1 | import type { NextConfig } from "next"; |
| 2 | |
| 3 | const GROVE_HUB_API_URL = process.env.GROVE_HUB_API_URL ?? "http://localhost:4001"; |
| 4 | const GROVE_API_URL = process.env.GROVE_API_URL ?? "http://localhost:4000"; |
| 5 | const nextConfig: NextConfig = { |
| 6 | output: "standalone", |
| 7 | allowedDevOrigins: ["grove.test", "collab.grove.test", "canopy.grove.test", "ring.grove.test"], |
| 8 | async rewrites() { |
| 9 | return [ |
| 10 | { |
| 11 | source: "/api/auth/:path*", |
| 12 | destination: `${GROVE_HUB_API_URL}/api/auth/:path*`, |
| 13 | }, |
| 14 | { |
| 15 | source: "/api/instances/:path*", |
| 16 | destination: `${GROVE_HUB_API_URL}/api/instances/:path*`, |
| 17 | }, |
| 18 | { |
| 19 | source: "/api/instances", |
| 20 | destination: `${GROVE_HUB_API_URL}/api/instances`, |
| 21 | }, |
| 22 | { |
| 23 | source: "/api/orgs/:path*", |
| 24 | destination: `${GROVE_HUB_API_URL}/api/orgs/:path*`, |
| 25 | }, |
| 26 | { |
| 27 | source: "/api/orgs", |
| 28 | destination: `${GROVE_HUB_API_URL}/api/orgs`, |
| 29 | }, |
| 30 | { |
| 31 | source: "/api/canopy/:path*", |
| 32 | destination: `${GROVE_API_URL}/api/canopy/:path*`, |
| 33 | }, |
| 34 | { |
| 35 | source: "/api/ring/:path*", |
| 36 | destination: `${GROVE_API_URL}/api/ring/:path*`, |
| 37 | }, |
| 38 | { |
| 39 | source: "/api/repos/:path*", |
| 40 | destination: `${GROVE_API_URL}/api/repos/:path*`, |
| 41 | }, |
| 42 | { |
| 43 | source: "/api/pages/:path*", |
| 44 | destination: `${GROVE_API_URL}/api/pages/:path*`, |
| 45 | }, |
| 46 | ]; |
| 47 | }, |
| 48 | }; |
| 49 | |
| 50 | export default nextConfig; |
| 51 | |