Reads data from .env (#7357)

This commit is contained in:
Bently
2024-07-09 17:20:31 +01:00
committed by GitHub
parent 0a28c72bad
commit 7929f1a4ac
3 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
const dotenv = require('dotenv');
dotenv.config();
module.exports = {
env: {
AGPT_SERVER_URL: process.env.AGPT_SERVER_URL,
},
};

View File

@@ -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",

View File

@@ -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(() => {