Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Reads data from .env (#7357)

Bently7929f1a4ac63
diff --git a/rnd/autogpt_builder/next.config.js b/rnd/autogpt_builder/next.config.js
new file mode 100644
index 0000000000..cb37ba2182
--- /dev/null
+++ b/rnd/autogpt_builder/next.config.js
@@ -0,0 +1,8 @@
+const dotenv = require('dotenv');
+dotenv.config();
+
+module.exports = {
+ env: {
+ AGPT_SERVER_URL: process.env.AGPT_SERVER_URL,
+ },
+};
diff --git a/rnd/autogpt_builder/package.json b/rnd/autogpt_builder/package.json
index 93c02a05db..51bda62d10 100644
--- a/rnd/autogpt_builder/package.json
+++ b/rnd/autogpt_builder/package.json
@@ -13,6 +13,7 @@
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
+ "dotenv": "^16.4.5",
"next": "14.2.4",
"next-themes": "^0.3.0",
"react": "^18",
diff --git a/rnd/autogpt_builder/src/components/Flow.tsx b/rnd/autogpt_builder/src/components/Flow.tsx
index 7fd7ef2cb9..66b2e57f8b 100644
--- a/rnd/autogpt_builder/src/components/Flow.tsx
+++ b/rnd/autogpt_builder/src/components/Flow.tsx
@@ -73,7 +73,7 @@ const FlowEditor: React.FC<{ flowID?: string }> = ({ flowID }) => {
const [agentName, setAgentName] = useState<string>('');
const [agentDescription, setAgentDescription] = useState<string>('');
- const apiUrl = 'http://localhost:8000';
+ const apiUrl = process.env.AGPT_SERVER_URL!;
const api = new AutoGPTServerAPI(apiUrl);
useEffect(() => {