service endpoint as environment variable

This commit is contained in:
kaichaosun 2024-05-22 10:32:23 +08:00
parent 670db33eb3
commit 5966a1b87a
No known key found for this signature in database
GPG Key ID: 223E0F992F4F03BF
3 changed files with 4 additions and 4 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
VITE_SERVICE_ENDPOINT="https://waku.whisperd.tech"

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "ferry-chat",
"name": "waku-frontend",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ferry-chat",
"name": "waku-frontend",
"version": "0.0.0",
"dependencies": {
"@radix-ui/react-dialog": "^1.0.5",

View File

@ -43,7 +43,6 @@ interface CommunityMetadata {
contentTopic: string;
}
const SERVICE_ENDPOINT = "https://waku.whisperd.tech";
const COMMUNITY_CONTENT_TOPIC_PREFIX = "/universal/1/community";
function App() {
@ -58,7 +57,7 @@ function App() {
CommunityMetadata[]
>([]);
const [communityName, setCommunityName] = useState("");
const [apiEndpoint, setApiEndpoint] = useState(SERVICE_ENDPOINT);
const [apiEndpoint, setApiEndpoint] = useState(import.meta.env.VITE_SERVICE_ENDPOINT);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const updateMessage = (e: any) => setNewMessage(e.target.value);