Chọn Deploy API:
prod.
Ở trang Stages:
prod đã được tạo.
Lưu thông tin API trong CloudShell, ghi URL vào v3/Site/js/config.js rồi upload v3:
echo 'export API_ID=<api-id>' >> ~/chat.env
echo 'export API_URL=https://<api-id>.execute-api.ap-northeast-1.amazonaws.com/prod' >> ~/chat.env && source ~/chat.env
cd ~/ws2-chatapp && sed -i "s#^ChatApp.apiEndpoint.*#ChatApp.apiEndpoint = '$API_URL';#" v3/Site/js/config.js
aws s3 cp v3/Site/js/ s3://$BUCKET/js/ --recursive --exclude '*desktop.ini' --only-show-errors
config.js đã trỏ tới API của bạn.config.js và site.js đã được upload.
Tải lại chats.html. Danh sách nhìn vẫn như cũ, nhưng dữ liệu giờ đến từ GET /conversations của API chứ không phải file JSON.