mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix: centralize API URL configuration in constants
- Move API base URL to single constant in @/constants/api - Update all API modules to import from centralized location - Ensure consistent port 8080 usage across frontend - Support VITE_API_URL environment variable for flexible deployment
This commit is contained in:
1 parent
e4e255b2bc
commit
1555a6d641
7 files changed
+19
-9
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { settingsApi } from "./settings";
|
||||
import axios from "axios";
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || "http://localhost:5001";
|
||||
import { API_BASE_URL } from "@/constants/api";
|
||||
|
||||
export interface Model {
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Repo } from './types'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_URL ?? 'http://localhost:5001'
|
||||
const API_BASE = API_BASE_URL
|
||||
|
||||
export async function createRepo(
|
||||
repoUrl: string,
|
||||
|
||||
@@ -7,8 +7,7 @@ import type {
|
||||
CreateOpenCodeConfigRequest,
|
||||
UpdateOpenCodeConfigRequest
|
||||
} from './types/settings'
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:5001'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
export const settingsApi = {
|
||||
getSettings: async (userId = 'default'): Promise<SettingsResponse> => {
|
||||
|
||||
Reference in new issue
Block a user