Skip to content

Commit

Permalink
CMDCT-4247 - gets run local to work YAY!
Browse files Browse the repository at this point in the history
  • Loading branch information
peoplespete committed Jan 28, 2025
1 parent 67ea977 commit 4a516c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 27 deletions.
1 change: 1 addition & 0 deletions services/app-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"minimist": "^1.2.5"
},
"main": "handler.js",
"type": "module",
"scripts": {},
"author": "",
"license": "CC0-1.0",
Expand Down
4 changes: 2 additions & 2 deletions services/ui-auth/libs/cognito-lib.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CognitoIdentityServiceProvider } from "@aws-sdk/client-cognito-identity-provider";
import { CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";

const COGNITO_CLIENT = new CognitoIdentityServiceProvider({
const COGNITO_CLIENT = new CognitoIdentityProviderClient({
apiVersion: "2016-04-19",
region: "us-east-1",
});
Expand Down
36 changes: 11 additions & 25 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,22 @@ async function run_db_locally(runner: LabeledProcessRunner) {
["serverless", "dynamodb", "install", "--stage=local"],
"services/database"
);
runner.run_command_and_output(
"db",
[
"serverless",
"offline",
"start",
"--stage",
"local",
"--lambdaPort",
"3003",
],
"services/database"
);
runner.run_command_and_output(
"db",
["serverless", "dynamodb", "start", "--stage=local"],
"services/database"
);
await new Promise((res) => setTimeout(res, 10 * 1000)); // The above runners need to all finish, not all can be awaited, they block
await new Promise((res) => setTimeout(res, 8 * 1000)); // The above runners need to all finish, not all can be awaited, they block
await runner.run_command_and_output(
"db",
"db-invoke",
[
"aws",
"lambda",
"serverless",
"invoke",
"/dev/null",
"--endpoint-url",
"http://localhost:3003",
"--function-name",
"database-local-seed",
"local",
"--function",
"seed",
"--stage",
"local"
],
"services/database"
);
Expand Down Expand Up @@ -124,9 +110,9 @@ async function run_fe_locally(runner: LabeledProcessRunner) {
async function run_all_locally() {
const runner = new LabeledProcessRunner();

await run_db_locally(runner);
await run_api_locally(runner);
await run_fe_locally(runner);
run_db_locally(runner);
run_api_locally(runner);
run_fe_locally(runner);
}

async function install_deps(runner: LabeledProcessRunner, service: string) {
Expand Down

0 comments on commit 4a516c1

Please sign in to comment.