Skip to content

Commit

Permalink
環境がUndefinedの場合はエラーになるように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-osho-san committed Mar 10, 2024
1 parent 87fbe5a commit 588d524
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/bin/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as cdk from "aws-cdk-lib";
import { BackendStack } from "../lib/backend-stack";

const app = new cdk.App();
const environment = app.node.tryGetContext("ENVIRONMENT");
const environment = app.node.tryGetContext("ENVIRONMENT") as string;
if (environment == undefined) {
throw new Error("envrionment is not set");
}
console.log(`environment = ${environment}`);
new BackendStack(app, "BackendStack", {
environment,
});

0 comments on commit 588d524

Please sign in to comment.