diff --git a/README.md b/README.md index 5094242c..623c1cc7 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,12 @@ This will open `http://localhost:5080` in your browser. By default, this will co > > See our backend repo [here](https://github.com/rivet-gg/rivet). -### Configuration `RIVET_ORIGIN_API` +### Configuration `RIVET_API_ENDPOINT` To configure the hub to connect to your own server (for example, `mydomain.com`), update the `.env` file in this folder to include the following: ``` -RIVET_ORIGIN_API=https://mydomain.com +RIVET_API_ENDPOINT=https://mydomain.com ``` ### Backend configuration diff --git a/src/config.ts b/src/config.ts index 3b1593bc..970d73e6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ // Provide default env if env variable is not defined. Any uses of `ENV.ABC` will be // overridden because of the WebPack `DefinePlugin`, so these act as defaults. -const RIVET_ORIGIN_API = localStorage.RIVET_ORIGIN_API || ENV_RIVET_ORIGIN_API; +const RIVET_API_ENDPOINT = localStorage.RIVET_API_ENDPOINT || ENV_RIVET_API_ENDPOINT; const config = { RIVET_NAMESPACE: ENV_RIVET_NAMESPACE, @@ -13,19 +13,19 @@ const config = { GIT_COMMIT: ENV_GIT_COMMIT, GIT_BRANCH: ENV_GIT_BRANCH, - ORIGIN_API: RIVET_ORIGIN_API as string, + ORIGIN_API: RIVET_API_ENDPOINT as string, ASSETS_URL: ENV_ASSETS_URL as string, - MEDIA_URL: RIVET_ORIGIN_API + '/media', + MEDIA_URL: RIVET_API_ENDPOINT + "/media", - API_AUTH_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'auth.', '/v1'), - API_PORTAL_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'portal.', '/v1'), - API_IDENTITY_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'identity.', '/v1'), - API_GROUP_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'group.', '/v1'), - API_CHAT_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'chat.', '/v1'), - API_CLOUD_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'cloud.', '/v1'), - API_KV_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'kv.', '/v1'), - API_PARTY_URL: modifyBaseUrl(RIVET_ORIGIN_API, 'party.', '/v1'), + API_AUTH_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'auth.', '/v1'), + API_PORTAL_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'portal.', '/v1'), + API_IDENTITY_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'identity.', '/v1'), + API_GROUP_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'group.', '/v1'), + API_CHAT_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'chat.', '/v1'), + API_CLOUD_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'cloud.', '/v1'), + API_KV_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'kv.', '/v1'), + API_PARTY_URL: modifyBaseUrl(RIVET_API_ENDPOINT, 'party.', '/v1'), COMMUNITY_URL: 'https://discord.com/invite/aXYfyNxYVn', DOCUMENTATION_URL: 'https://rivet.gg/docs', diff --git a/src/typings/global.d.ts b/src/typings/global.d.ts index 47514aab..2cb0ca5f 100644 --- a/src/typings/global.d.ts +++ b/src/typings/global.d.ts @@ -12,7 +12,7 @@ declare global { let ENV_RIVET_NAMESPACE: string; - let ENV_RIVET_ORIGIN_API: string; + let ENV_RIVET_API_ENDPOINT: string; let ENV_ASSETS_URL: string; interface Element { diff --git a/webpack.common.js b/webpack.common.js index 9324b121..6ccb3bb7 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -34,7 +34,7 @@ module.exports = async function () { RIVET_NAMESPACE: process.env.CF_PAGES_BRANCH, - RIVET_ORIGIN_API: process.env.RIVET_ORIGIN_API || 'https://staging.gameinc.io', + RIVET_API_ENDPOINT: process.env.RIVET_API_ENDPOINT || 'https://api.staging.gameinc.io', ASSETS_URL: process.env.ASSETS_URL }; for (let key in envValues) { diff --git a/yarn.lock b/yarn.lock index b9d1872f..0346079e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2205,7 +2205,7 @@ "@rivet-gg/common@https://github.com/rivet-gg/rivet-sdk-js#4f439a15506de88c24c0e08ae3e5fe05cb0c60a0": version "0.1.0" - resolved "git+ssh://git@github.com/rivet-gg/rivet-sdk-js.git#4f439a15506de88c24c0e08ae3e5fe05cb0c60a0" + resolved "https://github.com/rivet-gg/rivet-sdk-js#4f439a15506de88c24c0e08ae3e5fe05cb0c60a0" integrity sha512-itN3X/QvE7cpGa2LzveUS+/nsLMU6gVw8CLfDiMCruNSeiufkalPdnHMGpkpcy0UaI2sN1qAY34EIII4yftyhw== dependencies: node-fetch "^2.6.7"