deployPollingS3Object

Exports an async function that uploads the javascript, i.e. polling.js, to the S3 bucket. The purpose of doing this toward the end of our deployment is that we use this file to inject constants created along the way during the broader deployment, and export it for our main javascript file to import and access.

Source:

(require("deployPollingS3Object"))(region, bucketName, stagePollingUrl, pollFilePath, waitingRoomName, rate)

Source:

Exports deployPollingS3Object

Parameters:
Name Type Description
region String

A constant destructured from the CLI user's answers in deploy.js. Like "us-east-2".

bucketName String

Constant looks like beekeeper-${PROFILE_NAME}-s3

stagePollingUrl String

The public URL for the "/polling" resource of our API Gateway, was created and returned by deployPollingRoute.js

pollFilePath String

The file path where the polling.js file is located in the directory

waitingRoomName String

A constant destructured from answers in the CLI, will be the dynamic name shown in the waiting room HTML

rate Number

A constant destructured from answers in the CLI, used by the frontend JavaScript to show dynamic information to the user in waiting room.

Methods

(async, inner) uploadToS3(s3, bucketName, pollFilePath)

Source:

Function that uploads the polling.js file

Parameters:
Name Type Description
s3 S3Client

Looks like new S3Client({ region })

bucketName String

Constant looks like beekeeper-${PROFILE_NAME}-s3

pollFilePath String

The file path where the polling.js file is located in the directory