diff --git a/package.json b/package.json index 27a93a286..11bfc688b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build:prod": "ENV=production yarn transpile:sources && ENV=production yarn bundle-sw && ENV=production yarn bundle-sdk && ENV=production yarn bundle-page-sdk-es6 && bundlesize && ENV=production build/scripts/publish.sh", "test": "NODE_OPTIONS=\"--trace-warnings --unhandled-rejections=warn\" yarn run jest --detectOpenHandles --forceExit --runInBand", "publish": "yarn clean && yarn build:prod && yarn", - "build:dev-dev": "./build/scripts/build.sh -f development -t development", + "build:dev-dev": "./build/scripts/build.sh -f development -t development -a localhost", "build:dev-prod": "./build/scripts/build.sh -f development -t production", "build:dev-stag": "./build/scripts/build.sh -f development -t staging", "lint": "eslint src --ext .js,.jsx,.ts,.tsx; yarn prettylint 'src/**/*' 'test/**/*' '__test__/**/*' --no-editorconfig", diff --git a/src/shared/managers/SdkEnvironment.ts b/src/shared/managers/SdkEnvironment.ts index 28a767e39..56465b635 100644 --- a/src/shared/managers/SdkEnvironment.ts +++ b/src/shared/managers/SdkEnvironment.ts @@ -8,7 +8,7 @@ import Environment from '../helpers/Environment'; const RESOURCE_HTTP_PORT = 4000; const RESOURCE_HTTPS_PORT = 4001; -const API_URL_PORT = 3001; +const API_URL_PORT = 3000; const TURBINE_API_URL_PORT = 18080; const TURBINE_ENDPOINTS = ['outcomes', 'on_focus']; @@ -128,9 +128,9 @@ export default class SdkEnvironment { switch (buildEnv) { case EnvironmentKind.Development: if (SdkEnvironment.isTurbineEndpoint(action)) { - return new URL(`https://${apiOrigin}:${TURBINE_API_URL_PORT}/api/v1`); + return new URL(`http://${apiOrigin}:${TURBINE_API_URL_PORT}/api/v1`); } - return new URL(`https://${apiOrigin}:${API_URL_PORT}/api/v1`); + return new URL(`http://${apiOrigin}:${API_URL_PORT}/api/v1`); case EnvironmentKind.Staging: return new URL(`https://${apiOrigin}/api/v1`); case EnvironmentKind.Production: diff --git a/test/unit/modules/sdkEnvironment.ts b/test/unit/modules/sdkEnvironment.ts index cb137025e..744cb8abc 100644 --- a/test/unit/modules/sdkEnvironment.ts +++ b/test/unit/modules/sdkEnvironment.ts @@ -27,7 +27,7 @@ test('getWindowEnv should get host window environment', async (t) => { test('API URL should be valid for development environment', async (t) => { t.is( SdkEnvironment.getOneSignalApiUrl(EnvironmentKind.Development).toString(), - 'https://localhost:3001/api/v1', + 'https://localhost:3000/api/v1', ); });