version with dinamic port

This commit is contained in:
anovazzi1 2023-03-17 17:46:10 -03:00
commit f0261fed80
2 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LangFLow</title>
<script>
window.sessionStorage.setItem("port","http://localhost:7860")
</script>
</head>
<body id='body' style="width: 100%; height:100%">
<noscript>You need to enable JavaScript to run this app.</noscript>

View file

@ -1,7 +1,7 @@
import { APIObjectType, sendAllProps } from '../../types/api/index';
import axios, { AxiosResponse } from "axios";
const backendUrl = process.env.BACKEND || "http://localhost:7860";
const backendUrl = window.sessionStorage.getItem('port') || "http://localhost:7860";
export async function getAll():Promise<AxiosResponse<APIObjectType>> {
return await axios.get(`${backendUrl}/all`);