Skip to content

Commit

Permalink
Change API port number for use in dev-dev environments
Browse files Browse the repository at this point in the history
Motivation: the API dev environment uses 3000, not 3001
  • Loading branch information
rgomezp committed Feb 6, 2024
1 parent 4d149d6 commit 42ca70f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 42ca70f

Please sign in to comment.