File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,10 +151,17 @@ def create_app():
151151 from langflow .utils .version import get_version_info
152152
153153 __version__ = get_version_info ()["version" ]
154+ root_path = os .environ .get ("LANGFLOW_ROOT_PATH" , "" )
154155
155156 configure ()
156157 lifespan = get_lifespan (version = __version__ )
157- app = FastAPI (lifespan = lifespan , title = "Langflow" , version = __version__ )
158+ app = FastAPI (
159+ lifespan = lifespan ,
160+ title = "Langflow" ,
161+ version = __version__ ,
162+ root_path = root_path
163+ )
164+
158165 app .add_middleware (
159166 ContentSizeLimitMiddleware ,
160167 )
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ const DeleteAccountPage = lazy(() => import("./pages/DeleteAccountPage"));
4444// const PlaygroundPage = lazy(() => import("./pages/Playground"));
4545
4646const SignUp = lazy ( ( ) => import ( "./pages/SignUpPage" ) ) ;
47+ const rootPath = process . env . LANGFLOW_ROOT_PATH || "" ;
4748const router = createBrowserRouter (
4849 createRoutesFromElements ( [
4950 < Route
@@ -237,7 +238,7 @@ const router = createBrowserRouter(
237238 < Route path = "*" element = { < CustomNavigate replace to = "/" /> } />
238239 </ Route > ,
239240 ] ) ,
240- { basename : BASENAME || undefined } ,
241+ { basename : rootPath || BASENAME } ,
241242) ;
242243
243244export default router ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default defineConfig(({ mode }) => {
3030 } , { } ) ;
3131
3232 return {
33- base : BASENAME || "" ,
33+ base : env . LANGFLOW_ROOT_PATH || BASENAME || "" ,
3434 build : {
3535 outDir : "build" ,
3636 } ,
@@ -40,6 +40,7 @@ export default defineConfig(({ mode }) => {
4040 env . ACCESS_TOKEN_EXPIRE_SECONDS ,
4141 ) ,
4242 "process.env.CI" : JSON . stringify ( env . CI ) ,
43+ "process.env.LANGFLOW_ROOT_PATH" : JSON . stringify ( env . LANGFLOW_ROOT_PATH ) ,
4344 } ,
4445 plugins : [ react ( ) , svgr ( ) , tsconfigPaths ( ) ] ,
4546 server : {
You can’t perform that action at this time.
0 commit comments