File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ const S3Notifier = require('fastboot-s3-notifier');
1313
1414let notifier = new S3Notifier ({
1515 bucket: S3_BUCKET ,
16- key: S3_KEY
16+ key: S3_KEY ,
17+ region: AWS_REGION // optional
1718});
1819
1920let server = new FastBootAppServer ({
Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ const AWS = require('aws-sdk');
44
55const DEFAULT_POLL_TIME = 3 * 1000 ;
66
7- const s3 = new AWS . S3 ( {
8- apiVersion : '2006-03-01' ,
9- signatureVersion : 'v4'
10- } ) ;
11-
127class S3Notifier {
138 constructor ( options ) {
149 this . ui = options . ui ;
@@ -20,6 +15,12 @@ class S3Notifier {
2015 Bucket : this . bucket ,
2116 Key : this . key
2217 } ;
18+
19+ this . s3 = new AWS . S3 ( {
20+ apiVersion : '2006-03-01' ,
21+ signatureVersion : 'v4' ,
22+ region : options . region
23+ } ) ;
2324 }
2425
2526 subscribe ( notify ) {
@@ -30,7 +31,7 @@ class S3Notifier {
3031 }
3132
3233 getCurrentLastModified ( ) {
33- return s3 . headObject ( this . params ) . promise ( )
34+ return this . s3 . headObject ( this . params ) . promise ( )
3435 . then ( data => {
3536 this . lastModified = data . LastModified ;
3637 } )
@@ -46,7 +47,7 @@ class S3Notifier {
4647 }
4748
4849 poll ( ) {
49- s3 . headObject ( this . params ) . promise ( )
50+ this . s3 . headObject ( this . params ) . promise ( )
5051 . then ( data => {
5152 this . compareLastModifieds ( data . LastModified ) ;
5253 this . schedulePoll ( ) ;
You can’t perform that action at this time.
0 commit comments