From 1f0f2076a9863d3048312c2f8f27e9b5f0202678 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 7 Jan 2019 17:09:36 -0800 Subject: fix: CORS issue by accessing 0x geth nodes through 0x.org endpoint --- packages/website/ts/utils/configs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index fab382b07..663f90249 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -39,8 +39,8 @@ export const configs = { ] as OutdatedWrappedEtherByNetworkId[], // The order matters. We first try first node and only then fall back to others. PUBLIC_NODE_URLS_BY_NETWORK_ID: { - [1]: [`https://mainnet.infura.io/${INFURA_API_KEY}`, 'https://mainnet.0xproject.com'], - [42]: [`https://kovan.infura.io/${INFURA_API_KEY}`, 'https://kovan.0xproject.com'], + [1]: [`https://mainnet.infura.io/${INFURA_API_KEY}`, 'https://mainnet.0x.org'], + [42]: [`https://kovan.infura.io/${INFURA_API_KEY}`, 'https://kovan.0x.org'], [3]: [`https://ropsten.infura.io/${INFURA_API_KEY}`], [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, -- cgit v1.2.3 From eae255b0ff19965cb3cf78f55bdb7df4363af6d1 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 7 Jan 2019 17:19:36 -0800 Subject: chore: point to 0x.org website-api --- packages/website/ts/utils/configs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 663f90249..7cc854ca0 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -5,8 +5,8 @@ const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { AMOUNT_DISPLAY_PRECSION: 5, - BACKEND_BASE_PROD_URL: 'https://website-api.0xproject.com', - BACKEND_BASE_STAGING_URL: 'https://staging-website-api.0xproject.com', + BACKEND_BASE_PROD_URL: 'https://website-api.0x.org', + BACKEND_BASE_STAGING_URL: 'https://staging-website-api.0x.org', BASE_URL, BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', DEFAULT_DERIVATION_PATH: `44'/60'/0'`, -- cgit v1.2.3 From f412c36e23124da5ad6c0ee146a3c8063a60aacc Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 7 Jan 2019 17:31:38 -0800 Subject: fix: use old forum URL for now --- packages/website/ts/utils/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index ada8de549..c62de4eb3 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -2,7 +2,7 @@ import { ALink } from '@0x/react-shared'; import { BigNumber } from '@0x/utils'; import { Key, WebsitePaths } from 'ts/types'; -const URL_FORUM = 'https://forum.0x.org'; +const URL_FORUM = 'https://forum.0xproject.com'; const URL_ZEROEX_CHAT = 'https://discord.gg/d3FTX3M'; export const constants = { @@ -75,7 +75,7 @@ export const constants = { URL_APACHE_LICENSE: 'http://www.apache.org/licenses/LICENSE-2.0', URL_BITLY_API: 'https://api-ssl.bitly.com', URL_BLOG: 'https://blog.0xproject.com/latest', - URL_DISCOURSE_FORUM: 'https://forum.0x.org', + URL_DISCOURSE_FORUM: 'https://forum.0xproject.com', URL_ECOSYSTEM_APPLY: 'https://0x.smapply.io/', URL_ECOSYSTEM_BLOG_POST: 'https://blog.0xproject.com/announcing-the-0x-ecosystem-acceleration-program-89d1cb89d565', URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/', -- cgit v1.2.3 From 16fc2c3776f43a1fb9cc1f608c26e924741ba8cd Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 8 Jan 2019 10:34:40 -0800 Subject: fix: use new forum URL --- packages/website/ts/utils/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index c62de4eb3..ada8de549 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -2,7 +2,7 @@ import { ALink } from '@0x/react-shared'; import { BigNumber } from '@0x/utils'; import { Key, WebsitePaths } from 'ts/types'; -const URL_FORUM = 'https://forum.0xproject.com'; +const URL_FORUM = 'https://forum.0x.org'; const URL_ZEROEX_CHAT = 'https://discord.gg/d3FTX3M'; export const constants = { @@ -75,7 +75,7 @@ export const constants = { URL_APACHE_LICENSE: 'http://www.apache.org/licenses/LICENSE-2.0', URL_BITLY_API: 'https://api-ssl.bitly.com', URL_BLOG: 'https://blog.0xproject.com/latest', - URL_DISCOURSE_FORUM: 'https://forum.0xproject.com', + URL_DISCOURSE_FORUM: 'https://forum.0x.org', URL_ECOSYSTEM_APPLY: 'https://0x.smapply.io/', URL_ECOSYSTEM_BLOG_POST: 'https://blog.0xproject.com/announcing-the-0x-ecosystem-acceleration-program-89d1cb89d565', URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/', -- cgit v1.2.3 From d00dd07435ff4d87b0868cfe9c5426fc191d9b23 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 8 Jan 2019 16:45:35 -0800 Subject: fix: use getBackendBaseUrl instead of hardcoded string --- packages/website/ts/components/modals/modal_contact.tsx | 3 ++- packages/website/ts/components/newsletter_form.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/components/modals/modal_contact.tsx b/packages/website/ts/components/modals/modal_contact.tsx index a3a1f13f5..7414df7d9 100644 --- a/packages/website/ts/components/modals/modal_contact.tsx +++ b/packages/website/ts/components/modals/modal_contact.tsx @@ -12,6 +12,7 @@ import { Icon } from 'ts/components/icon'; import { Input, InputWidth } from 'ts/components/modals/input'; import { Heading, Paragraph } from 'ts/components/text'; import { GlobalStyle } from 'ts/constants/globalStyle'; +import { utils } from 'ts/utils/utils'; export enum ModalContactType { General = 'GENERAL', @@ -279,7 +280,7 @@ export class ModalContact extends React.Component { try { // Disabling no-unbound method b/c no reason for _.isEmpty to be bound // tslint:disable:no-unbound-method - const response = await fetch(`https://website-api.0xproject.com${endpoint}`, { + const response = await fetch(`${utils.getBackendBaseUrl()}${endpoint}`, { method: 'post', mode: 'cors', credentials: 'same-origin', diff --git a/packages/website/ts/components/newsletter_form.tsx b/packages/website/ts/components/newsletter_form.tsx index 4a7abb7ec..bd61e3f4d 100644 --- a/packages/website/ts/components/newsletter_form.tsx +++ b/packages/website/ts/components/newsletter_form.tsx @@ -4,6 +4,7 @@ import styled, { withTheme } from 'styled-components'; import { ThemeValuesInterface } from 'ts/components/siteWrap'; import { colors } from 'ts/style/colors'; import { errorReporter } from 'ts/utils/error_reporter'; +import { utils } from 'ts/utils/utils'; interface FormProps { theme: ThemeValuesInterface; @@ -92,7 +93,7 @@ class Form extends React.Component { } try { - await fetch('https://website-api.0x.org/newsletter_subscriber/substack', { + await fetch(`${utils.getBackendBaseUrl()}/newsletter_subscriber/substack`, { method: 'post', mode: 'cors', headers: { -- cgit v1.2.3