diff --git a/web/.env.dev b/web/.env.dev deleted file mode 100644 index 547f694..0000000 --- a/web/.env.dev +++ /dev/null @@ -1 +0,0 @@ -BASE_URL=http://localhost:8000/api/ diff --git a/web/.env.development b/web/.env.development new file mode 100644 index 0000000..e6532df --- /dev/null +++ b/web/.env.development @@ -0,0 +1 @@ +VITE_BASE_URL=http://localhost:8000/api/ diff --git a/web/.env.prod b/web/.env.prod deleted file mode 100644 index 3ecbb4f..0000000 --- a/web/.env.prod +++ /dev/null @@ -1 +0,0 @@ -BASE_URL=https://printers.pp.ifms.edu.br/api/ diff --git a/web/.env.production b/web/.env.production new file mode 100644 index 0000000..0d04996 --- /dev/null +++ b/web/.env.production @@ -0,0 +1 @@ +VITE_BASE_URL=https://printers.pp.ifms.edu.br/api/ diff --git a/web/src/api.ts b/web/src/api.ts index 7a23c70..268480d 100644 --- a/web/src/api.ts +++ b/web/src/api.ts @@ -1,4 +1,4 @@ -const BASE_URL = process.env.BASE_URL || 'http://localhost:8000/api/' +const BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8000/api/' export async function api(endpoint: string, options: any): Promise { const token = localStorage.getItem('token')