mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[staff] Remove .env.local and rename the env var to match main photos apps
This commit is contained in:
parent
99833e287c
commit
f5a90abbaf
9
infra/staff/.env
Normal file
9
infra/staff/.env
Normal file
@ -0,0 +1,9 @@
|
||||
# This is a sample .env file. The env vars defined here can be used to configure
|
||||
# the app.
|
||||
#
|
||||
# For local development, create a new file named `.env.local` and add the
|
||||
# variables you need there instead of uncommenting them below.
|
||||
#
|
||||
# For documentation about the variables, see `src/vite-env.d.ts`.
|
||||
|
||||
# VITE_ENTE_API_ORIGIN = http://localhost:8080
|
@ -1 +0,0 @@
|
||||
VITE_ENTE_ENDPOINT = http://localhost:8080
|
@ -1,10 +1,8 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { apiOrigin } from "./services/support";
|
||||
import S from "./utils/strings";
|
||||
|
||||
export const App: React.FC = () => {
|
||||
const [serverUrl /*, setServerUrl */] = useState(
|
||||
import.meta.env.VITE_ENTE_ENDPOINT || "",
|
||||
);
|
||||
const [token, setToken] = useState("");
|
||||
const [email, setEmail] = useState("");
|
||||
const [userData, setUserData] = useState<any>(null);
|
||||
@ -15,7 +13,6 @@ export const App: React.FC = () => {
|
||||
if (storedToken) {
|
||||
setToken(storedToken);
|
||||
}
|
||||
console.log(import.meta.env.VITE_ENTE_ENDPOINT);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@ -28,7 +25,7 @@ export const App: React.FC = () => {
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const url = `${serverUrl}/admin/user?email=${email}&token=${token}`;
|
||||
const url = `${apiOrigin}/admin/user?email=${email}&token=${token}`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const apiOrigin = import.meta.env.VITE_ENTE_ENDPOINT ?? "https://api.ente.io";
|
||||
export const apiOrigin = import.meta.env.VITE_ENTE_API_ORIGIN ?? "https://api.ente.io";
|
||||
|
||||
const UserDetails = z.object({}).passthrough();
|
||||
|
4
infra/staff/src/vite-env.d.ts
vendored
4
infra/staff/src/vite-env.d.ts
vendored
@ -8,9 +8,9 @@ interface ImportMetaEnv {
|
||||
/**
|
||||
* Override the origin (scheme://host:port) of Ente's API to connect to.
|
||||
*
|
||||
* This is useful when testing or connecting to alternative installations.
|
||||
* Default is "https://api.ente.io".
|
||||
*/
|
||||
readonly VITE_ENTE_ENDPOINT: string | undefined;
|
||||
readonly VITE_ENTE_API_ORIGIN: string | undefined;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
Loading…
x
Reference in New Issue
Block a user