Clone the back-end source code from https://github.com/hdthinh1012/aws-workshop-0-hls-streaming.
Then cd into the project folder and create environment file .env
and add the following text.
PORT=8080
SERVER_URL=http://<your-ec2-public-ip>:8080 // [Delete this comment before start server] For static file serve
AWS_ACCESS_KEY_ID=<your_iam_access_key_id>
AWS_SECRET_ACCESS_KEY=<your_iam_secret_access_key>
BUCKET_NAME=<your-bucket-name>
IS_AWS_S3=1 // [Delete this comment before start server] or 0 for local file system
AWS_S3_BUCKET_PATH=<your-mounted-s3fs-location>
Replace <your_iam_access_key_id>
, <your_iam_secret_access_key>
with your IAM user corresponding access key id and secret access key, <your-bucket-name>
with your newly created S3 bucket’s name and <your-mounted-s3fs-location>
with the local file system path on EC2 instance that is used for S3FS-FUSE mount system from the section 2.2.
Then run npm install
to install all dependencies.
Run npm run build
for Webpack bundler and npm run start
. The back-end web is serving at the port 8080 (or any port configured in .env).