Skip to content

Commit

Permalink
Merge branch 'feature/hub-94' of https://github.com/rivet-gg/hub into…
Browse files Browse the repository at this point in the history
… feature/hub-94
  • Loading branch information
yusufsallam64 committed Oct 16, 2023
2 parents 3f43ffd + 2ace2b3 commit 12fdf10
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 12fdf10

Please sign in to comment.