Fix dev web server setup

This commit is contained in:
Weves 2023-05-22 14:01:20 -07:00 committed by Chris Weaver
parent f4ef92e279
commit 49804dcc44
2 changed files with 7 additions and 7 deletions

View File

@ -16,6 +16,8 @@ COPY src ./src
COPY public ./public
COPY next.config.js .
COPY tsconfig.json .
COPY tailwind.config.js .
COPY postcss.config.js .
# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry
# Uncomment the following line to disable telemetry at run time

View File

@ -6,16 +6,14 @@ const nextConfig = {
output: "standalone",
redirects: async () => {
// In production, something else (nginx in the one box setup) should take
// care of this redirect. Leaving in for now due to issues with dev setup
// and accessing `process.env.NODE_ENV` + for cases where people don't want
// to setup nginx and are okay with the frontend proxying the request.
// TODO (chris): better support non-nginx setups
// care of this redirect. TODO (chris): better support setups where
// web_server and api_server are on different machines.
if (process.env.NODE_ENV === "production") return [];
return [
{
source: "/api/:path*",
destination: `${
process.env.INTERNAL_URL || "http://localhost:8080"
}/:path*`, // Proxy to Backend
destination: "http://localhost:8080/:path*", // Proxy to Backend
permanent: true,
},
];