Skip to content

Commit 80e2a69

Browse files
fixup: env var controls api/reads debug mode
1 parent d8de92b commit 80e2a69

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

graphql-api/start.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export CACHE_REDIS_URL="${CACHE_REDIS_URL:-$DEFAULT_CACHE_REDIS_URL}"
1414
DEFAULT_RATE_LIMITER_REDIS_URL="redis://localhost:6379/2"
1515
export RATE_LIMITER_REDIS_URL="${RATE_LIMITER_REDIS_URL:-$DEFAULT_RATE_LIMITER_REDIS_URL}"
1616

17-
pnpm ts-node ./src/app.ts
18-
# To use an interactive debugger with the API codebase, comment out the
19-
# command above and uncomment the following:
20-
# pnpm node -r ts-node/register --inspect ./src/app.ts
17+
if [[ -n ${DEBUG:-""} ]]; then
18+
# Invoking Node with these flags allows us to attach the interactive
19+
# debugger for Node that's built into Chrome.
20+
pnpm node -r ts-node/register --inspect ./src/app.ts
21+
else
22+
pnpm ts-node ./src/app.ts
23+
fi

reads/start.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ export NODE_ENV="development"
77
DEFAULT_PORT="8000"
88
export PORT=${PORT:-$DEFAULT_PORT}
99

10-
pnpm nodemon ./src/server.js
11-
#pnpm node -r ts-node/register --inspect ./src/server.js
10+
if [[ -n ${DEBUG:-""} ]]; then
11+
# Invoking Node with these flags allows us to attach the interactive
12+
# debugger for Node that's built into Chrome.
13+
pnpm node -r ts-node/register --inspect ./src/server.js
14+
else
15+
pnpm nodemon ./src/server.js
16+
fi

0 commit comments

Comments
 (0)