mirror of
https://github.com/langchain-ai/langchain-extract.git
synced 2026-07-01 20:24:03 -04:00
next public env prefix (#82)
This commit is contained in:
@@ -28,7 +28,7 @@ jobs:
|
||||
name: Build frontend
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BASE_API_URL: http://localhost:8000
|
||||
NEXT_PUBLIC_BASE_API_URL: http://localhost:8000
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 18.x
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Only set for non development builds.
|
||||
# Development builds default to `http://localhost:8000`
|
||||
BASE_API_URL=https://example.com
|
||||
NEXT_PUBLIC_BASE_API_URL=https://example.com
|
||||
@@ -2,8 +2,10 @@ export const getBaseApiUrl = () => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return "http://localhost:8000";
|
||||
}
|
||||
if (!process.env.BASE_API_URL) {
|
||||
throw new Error("BASE_API_URL must be set if not in development.");
|
||||
if (!process.env.NEXT_PUBLIC_BASE_API_URL) {
|
||||
throw new Error(
|
||||
"NEXT_PUBLIC_BASE_API_URL must be set if not in development.",
|
||||
);
|
||||
}
|
||||
return process.env.BASE_API_URL;
|
||||
return process.env.NEXT_PUBLIC_BASE_API_URL;
|
||||
};
|
||||
|
||||
@@ -12,7 +12,9 @@ export function middleware(request: NextRequest) {
|
||||
const userId = request.cookies.get(USER_ID_COOKIE_KEY);
|
||||
|
||||
if (!userId) {
|
||||
response.cookies.set(USER_ID_COOKIE_KEY, uuidv4());
|
||||
response.cookies.set(USER_ID_COOKIE_KEY, uuidv4(), {
|
||||
|
||||
});
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user