Skip to content

Commit

Permalink
Merge pull request #1157 from OneSignal/dev-dev-config-update
Browse files Browse the repository at this point in the history
Adjustments for Dev-Dev Environments
  • Loading branch information
rgomezp authored Jun 11, 2024
2 parents 535511a + 23b9f87 commit ff52c3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/shared/managers/SdkEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/sdkEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});

Expand Down

0 comments on commit ff52c3c

Please sign in to comment.