aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2019-01-10 04:03:28 +0800
committerGitHub <noreply@github.com>2019-01-10 04:03:28 +0800
commit87c287a5e26e89ee25dd43793415d00d4ddfd5fa (patch)
treeeb36586691d062c1a1dcfdf2b283bda30c649189
parente39ef60775728ae5d61e9090dc11f51ed5779178 (diff)
parentd00dd07435ff4d87b0868cfe9c5426fc191d9b23 (diff)
downloaddexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar.gz
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar.bz2
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar.lz
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar.xz
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.tar.zst
dexon-sol-tools-87c287a5e26e89ee25dd43793415d00d4ddfd5fa.zip
Merge pull request #1489 from 0xProject/fix/website/0x-org-endpoints
[website] Audit and fix 0x.org migration URLs
-rw-r--r--packages/website/ts/components/modals/modal_contact.tsx3
-rw-r--r--packages/website/ts/components/newsletter_form.tsx3
-rw-r--r--packages/website/ts/utils/configs.ts8
3 files changed, 8 insertions, 6 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<Props> {
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<FormProps> {
}
try {
- await fetch('https://website-api.0x.org/newsletter_subscriber/substack', {
+ await fetch(`${utils.getBackendBaseUrl()}/newsletter_subscriber/substack`, {
method: 'post',
mode: 'cors',
headers: {
diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts
index fab382b07..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'`,
@@ -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,