mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: add HOSTNAME and VITE_HOSTNAME support for improved server URL configuration
- Introduced `HOSTNAME` environment variable for user-facing URLs, defaulting to localhost. - Updated server and client code to utilize `HOSTNAME` for constructing URLs instead of hardcoded localhost. - Enhanced documentation in CLAUDE.md to reflect new configuration options. - Added `VITE_HOSTNAME` for frontend API URLs, ensuring consistent hostname usage across the application. These changes improve flexibility in server configuration and enhance the user experience by providing accurate URLs.
This commit is contained in:
@@ -157,7 +157,9 @@ const getServerUrl = (): string => {
|
||||
const envUrl = import.meta.env.VITE_SERVER_URL;
|
||||
if (envUrl) return envUrl;
|
||||
}
|
||||
return 'http://localhost:3008';
|
||||
// Use VITE_HOSTNAME if set, otherwise default to localhost
|
||||
const hostname = import.meta.env.VITE_HOSTNAME || 'localhost';
|
||||
return `http://${hostname}:3008`;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -557,6 +559,7 @@ export interface DevServerLogsResponse {
|
||||
result?: {
|
||||
worktreePath: string;
|
||||
port: number;
|
||||
url: string;
|
||||
logs: string;
|
||||
startedAt: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user