From 14afd32cd9696b27cd706e2de7ed6ac1ad91d97e Mon Sep 17 00:00:00 2001 From: Aurora Walker <663009+aurorawalker@users.noreply.github.com> Date: Mon, 8 Mar 2021 17:01:57 -0800 Subject: [PATCH] Dev (#23) * Fixing variable names for APP_VERSION * Env vars must start with REACT_APP_ Co-authored-by: Aurora Walker --- Dockerfile | 2 +- src/utils/engine-client.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f69b649..7315796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:10.19-alpine AS build ARG APP_VERSION -ENV APP_VERSION=$APP_VERSION +ENV REACT_APP_VERSION=$APP_VERSION COPY . . RUN npm ci diff --git a/src/utils/engine-client.js b/src/utils/engine-client.js index 76fa701..485aefb 100644 --- a/src/utils/engine-client.js +++ b/src/utils/engine-client.js @@ -5,7 +5,7 @@ import { isLastFrameOfGame } from "./game-state"; const DEFAULT_SNAKE_HEAD = "default"; const DEFAULT_SNAKE_TAIL = "default"; -const APP_VERSION = process.env.APP_VERSION; +const APP_VERSION = process.env.REACT_APP_VERSION; async function get(url, query) { const response = await fetch(url + makeQueryString(query)); @@ -92,8 +92,8 @@ function isIllegalSvgPath(nameOrPath) { } function svgUrlFromName(base, relative) { - //appending the image tag of this version allows for cache busting on deploy - const extension = ".svg?boardVersion=" + APP_VERSION; + //appending the git hash of this version allows for cache busting on deploy + const extension = ".svg?board_version=" + APP_VERSION; return join("https://media.battlesnake.com", base, relative) + extension; }