Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments for Dev-Dev Environments #1157

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading