Skip to content

Commit

Permalink
fix: add custom url for .vote, without the last forward slash (#1699)
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu authored Mar 5, 2024
1 parent 73bdd83 commit a31583d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "jest --no-cache --runInBand",
"build": "npm run build:server && npm run build:front",
"build:server": "tsc -p .",
"build:front": "GATSBY_VERSION_NUMBER=$VERSION_NUMBER gatsby build --prefix-paths",
"build:front": "GATSBY_VERSION_NUMBER=$VERSION_NUMBER GATSBY_HEROKU_APP_NAME=$HEROKU_APP_NAME gatsby build --prefix-paths",
"develop": "gatsby develop --https -H 0.0.0.0",
"format": "prettier --write \"**/*.{js,jsx,json,md,ts,tsx}\"",
"start": "concurrently -c blue,green -n SERVER,FRONT 'npm run serve' 'npm run develop'",
Expand Down
10 changes: 9 additions & 1 deletion src/clients/Governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ export type GetProposalsFilter = ProposalListFilter & {
offset: number
}

const getGovernanceApiUrl = () => {
if (process.env.GATSBY_HEROKU_APP_NAME) {
return `https://governance.decentraland.vote/api`
}

return GOVERNANCE_API
}

export class Governance extends API {
static Url = GOVERNANCE_API
static Url = getGovernanceApiUrl()

static Cache = new Map<string, Governance>()

Expand Down

0 comments on commit a31583d

Please sign in to comment.