diff --git a/README.md b/README.md index e13622d..5ebdbc3 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,17 @@ To run just the frontend, first install dependencies with ```bash npm i ``` -In `next.config.js`, set `env.API_URL` to the public API URL of the rCTF instance, and `KLODD_URL` to the public URL of +In `next.config.js`, set `RCTF_BASE` to the public URL of the backend rCTF instance, and `KLODD_URL` to the public URL of the Klodd instancer frontend: ```js +const RCTF_BASE = 'http://ctf.b01lers.com:9000'; + const nextConfig = { env: { - API_BASE: 'http://ctf.b01lers.com:9000/api/v1', + API_BASE: `${RCTF_BASE}/api/v1`, KLODD_URL: 'https://klodd.localhost.direct' - } + }, + // ... } ``` Then, run @@ -49,7 +52,7 @@ RCTF_GIT_REF=master You can then start both the rCTF backend and production frontend instance simultaneously with ```bash -docker-compose up -d --build +docker compose up -d --build ``` ### Configuring diff --git a/util/strings.ts b/util/strings.ts index 59941dd..599f50b 100644 --- a/util/strings.ts +++ b/util/strings.ts @@ -1,6 +1,6 @@ export function pluralize(num: number) { - if (num % 10 === 1) return `${num}st`; - if (num % 10 === 2) return `${num}nd`; - if (num % 10 === 3) return `${num}rd`; + if (num % 10 === 1 && num !== 11) return `${num}st`; // 21st, but not 11th + if (num % 10 === 2 && num !== 12) return `${num}nd`; // 32nd, but not 12th + if (num % 10 === 3 && num !== 13) return `${num}rd`; // 63rd, but not 13th return `${num}th` }