Skip to content

Commit 4fcf435

Browse files
committed
fix(development): exposing APP_SERVER_URL env var to public
1 parent 9cb30e1 commit 4fcf435

File tree

27 files changed

+34
-32
lines changed

27 files changed

+34
-32
lines changed

src/client/.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For env vars related to the Google project and Auth0 setup, comment in the discussion titled 'Request Environment Variables (.env) Here' (https://github.com/existence-master/Sentient/discussions/13) Make sure to keep the values in this file empty while committing to the repository
22

3-
APP_SERVER_URL=
3+
NEXT_PUBLIC_APP_SERVER_URL=
44
AUTH0_SECRET=
55
AUTH0_BASE_URL="http://localhost:3000" # The base URL of your Next.js app, where it's running
66
AUTH0_ISSUER_BASE_URL="" # Your Auth0 domain with protocol, e.g. "https://YOUR_TENANT.us.auth0.com"

src/client/app/api/chat/message/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
1515

1616
// Fetch user pricing/credits to pass to the backend
1717
const pricingResponse = await fetch(
18-
`${process.env.APP_SERVER_URL}/api/get-user-data`,
18+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/api/get-user-data`,
1919
{
2020
method: "POST",
2121
headers: { "Content-Type": "application/json", ...authHeader }
@@ -26,7 +26,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
2626
const credits = userData?.data?.proCredits || 0
2727

2828
const backendResponse = await fetch(
29-
`${process.env.APP_SERVER_URL}/chat/message`,
29+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/chat/message`,
3030
{
3131
method: "POST",
3232
headers: { "Content-Type": "application/json", ...authHeader },

src/client/app/api/integrations/connected/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
66
try {
77
// This reuses the same backend endpoint but we will filter on the client
88
const response = await fetch(
9-
`${process.env.APP_SERVER_URL}/integrations/sources`,
9+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/integrations/sources`,
1010
{
1111
method: "GET",
1212
headers: { "Content-Type": "application/json", ...authHeader }

src/client/app/api/journal/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextResponse } from "next/server"
22
import { withAuth } from "@lib/api-utils"
33

4-
const APP_SERVER_URL = process.env.APP_SERVER_URL
4+
const APP_SERVER_URL = process.env.NEXT_PUBLIC_APP_SERVER_URL
55

66
// GET: Fetch blocks for a specific date or date range
77
export const GET = withAuth(async function GET(request, { authHeader }) {

src/client/app/api/notifications/delete/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
1212
}
1313

1414
const response = await fetch(
15-
`${process.env.APP_SERVER_URL}/notifications/delete`,
15+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/notifications/delete`,
1616
{
1717
method: "POST",
1818
headers: { "Content-Type": "application/json", ...authHeader },

src/client/app/api/notifications/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { withAuth } from "@lib/api-utils"
55
export const GET = withAuth(async function GET(request, { authHeader }) {
66
try {
77
const response = await fetch(
8-
`${process.env.APP_SERVER_URL}/notifications`,
8+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/notifications`,
99
{
1010
method: "GET",
1111
headers: { "Content-Type": "application/json", ...authHeader }

src/client/app/api/onboarding/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
77
// FIX: The request body from the client is already in the correct format { data: ... }.
88
// It should not be wrapped again.
99
const response = await fetch(
10-
`${process.env.APP_SERVER_URL}/api/onboarding`,
10+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/api/onboarding`,
1111
{
1212
method: "POST",
1313
headers: { "Content-Type": "application/json", ...authHeader },

src/client/app/api/settings/google-auth/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { withAuth } from "@lib/api-utils"
44
export const GET = withAuth(async function GET(request, { authHeader }) {
55
try {
66
const response = await fetch(
7-
`${process.env.APP_SERVER_URL}/api/get-user-data`,
7+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/api/get-user-data`,
88
{
99
method: "POST", // This endpoint is a POST to carry the auth header
1010
headers: { "Content-Type": "application/json", ...authHeader }
@@ -45,7 +45,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
4545
}
4646

4747
const response = await fetch(
48-
`${process.env.APP_SERVER_URL}/api/settings/google-auth`,
48+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/api/settings/google-auth`,
4949
{
5050
method: "POST",
5151
headers: { "Content-Type": "application/json", ...authHeader },

src/client/app/api/settings/integrations/connect/manual/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
55
try {
66
const body = await request.json() // { service_name, credentials }
77
const response = await fetch(
8-
`${process.env.APP_SERVER_URL}/integrations/connect/manual`,
8+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/integrations/connect/manual`,
99
{
1010
method: "POST",
1111
headers: { "Content-Type": "application/json", ...authHeader },

src/client/app/api/settings/integrations/connect/oauth/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
66
try {
77
const body = await request.json() // { service_name, code, redirect_uri }
88
const response = await fetch(
9-
`${process.env.APP_SERVER_URL}/integrations/connect/oauth`,
9+
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/integrations/connect/oauth`,
1010
{
1111
method: "POST",
1212
headers: { "Content-Type": "application/json", ...authHeader },

0 commit comments

Comments
 (0)