Skip to content

Commit

Permalink
Dev (#23)
Browse files Browse the repository at this point in the history
* Fixing variable names for APP_VERSION

* Env vars must start with REACT_APP_

Co-authored-by: Aurora Walker <[email protected]>
  • Loading branch information
aurorawalker and Aurora Walker authored Mar 9, 2021
1 parent 9f27362 commit 14afd32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/utils/engine-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 14afd32

Please sign in to comment.