🐛 Fix VITE_API_URL reference

This commit is contained in:
nikolark committed 2022-02-20 01:25:55 +01:00
1 parent faca98b7f9
commit 3e457de416
5 files changed
+5 -4

No files matched your search

+1
View File
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:3000
+1
View File
@@ -13,3 +13,4 @@ tmp/
frontend/dist frontend/dist
static/modern static/modern
.python-version .python-version
.env
+1
View File
@@ -9,6 +9,7 @@ poetry shell
pre-commit install pre-commit install
python manage.py migrate python manage.py migrate
bin/run bin/run
cp .env-default .env
# in another terminal # in another terminal
cd frontend cd frontend
+1 -1
View File
@@ -1,7 +1,7 @@
import { ApolloClient, InMemoryCache } from "@apollo/client"; import { ApolloClient, InMemoryCache } from "@apollo/client";
const client = new ApolloClient({ const client = new ApolloClient({
uri: import.meta.env.VITE_API_URL || "http://localhost:8000/graphql/", uri: `${import.meta.env.VITE_API_URL}/graphql/`,
cache: new InMemoryCache(), cache: new InMemoryCache(),
}); });
+1 -3
View File
@@ -8,9 +8,7 @@ import { NavLink } from "react-router-dom";
import { ReactComponent as Logo } from "../assets/brick.svg"; import { ReactComponent as Logo } from "../assets/brick.svg";
import styles from "./Header.module.css"; import styles from "./Header.module.css";
const ADMIN_URL = import.meta.env.VITE_API_URL const ADMIN_URL = `${import.meta.env.VITE_API_URL}/admin`;
? `${import.meta.env.VITE_API_URL}/admin`
: "http://localhost:8000/admin/";
const navLinkStyles = ({ isActive }: { isActive: boolean }) => (isActive ? "nav-link active" : "nav-link"); const navLinkStyles = ({ isActive }: { isActive: boolean }) => (isActive ? "nav-link active" : "nav-link");