Skip to content

Commit

Permalink
Replace Environment.shared with Environment() (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler authored Jun 24, 2024
1 parent 83a6735 commit 514c4f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth-jwt/Sources/App/Application+build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protocol AppArguments {
}

func buildApplication(_ args: AppArguments) async throws -> some ApplicationProtocol {
let env = try await Environment.shared.merging(with: .dotEnv())
let env = try await Environment().merging(with: .dotEnv())
let logger = {
var logger = Logger(label: "auth-jwt")
logger.logLevel = .debug
Expand Down
3 changes: 2 additions & 1 deletion todos-lambda/Sources/App/lambda.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct AppLambda: APIGatewayLambdaFunction {
}

func buildResponder() -> some HTTPResponder<Context> {
let tableName = Environment.shared.get("TODOS_TABLE_NAME") ?? "hummingbird-todos"
let env = Environment()
let tableName = env.get("TODOS_TABLE_NAME") ?? "hummingbird-todos"
self.logger.info("Using table \(tableName)")
let dynamoDB = DynamoDB(client: awsClient, region: .euwest1)

Expand Down

0 comments on commit 514c4f4

Please sign in to comment.