Skip to content

Commit

Permalink
Merge pull request BinaryStudioAcademy#284 from mV22110702/fix/th-283…
Browse files Browse the repository at this point in the history
…-fix-env-for-s3

th-283: Fixed .env.example
  • Loading branch information
kalinkaaaa14 committed Sep 18, 2023
2 parents aed4e30 + 1d57a8b commit 0fe77e4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ AWS_ACCESS_KEY_ID=YOUR_KEY
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
S3_REGION=REGION
BUCKET_NAME=BUCKET
SIGNED_URL_EXPIRES_IN_SECONDS=NUMBER

#
# SENDGRID
Expand Down
4 changes: 2 additions & 2 deletions backend/src/libs/packages/config/config.package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class Config implements IConfig {
env: 'S3_REGION',
default: null,
},
SIGNED_URL_EXPIRES_IN: {
SIGNED_URL_EXPIRES_IN_SECONDS: {
doc: 'Number of seconds a signed URL expires in',
format: String,
env: 'SIGNED_URL_EXPIRES_IN',
env: 'SIGNED_URL_EXPIRES_IN_SECONDS',
default: null,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type EnvironmentSchema = {
S3: {
BUCKET_NAME: string;
REGION: string;
SIGNED_URL_EXPIRES_IN: number;
SIGNED_URL_EXPIRES_IN_SECONDS: number;
};
};
JWT: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class S3ClientService {
},
});
this.bucketName = config.ENV.AWS.S3.BUCKET_NAME;
this.signedUrlExpiresIn = config.ENV.AWS.S3.SIGNED_URL_EXPIRES_IN;
this.signedUrlExpiresIn = config.ENV.AWS.S3.SIGNED_URL_EXPIRES_IN_SECONDS;
this.logger = logger;
}

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ erDiagram
files {
id serial PK "not null"
key varchar "not null, unique"
name varchar "not null"
content_type varchar "not null"
created_at timestamp "not null"
updated_at timestamp "not null"
Expand Down

0 comments on commit 0fe77e4

Please sign in to comment.