Skip to content

Commit

Permalink
Fix error when trying to print project URL(s) after deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Feb 14, 2024
1 parent 3099ddf commit f4ff0c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

---

## [5.0.3] 2024-02-13

### Fixed

- Fixed issue where entirely custom Lambda-based projects may error when trying to print the project's URL(s) after deploying

---

## [5.0.0 - 5.0.2] 2024-02-01

### Added
Expand Down
16 changes: 8 additions & 8 deletions src/sam/02-after/00-get-app-apex/reads.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ module.exports = function reads ({ aws, stackname, stage }, callback){
let http = o => o.OutputKey === 'HTTP'

let apigateway = cf.find(function (distro) {
let origin = outs.find(api)
let origin = outs?.find(api)
if (!origin) return false
let dist = distro.origin
let orig = clean(origin.OutputValue)
return dist === orig
}) || false

let s3 = cf.find(function (distro) {
let origin = outs.find(bucket)
let origin = outs?.find(bucket)
if (!origin) return false
let dist = distro.origin
let orig = clean(origin.OutputValue)
return dist === orig
}) || false

let cdnURL = outs.find(cdn) ? outs.find(cdn).OutputValue : false
let apiURL = outs.find(api) ? outs.find(api).OutputValue : false
let wssURL = outs.find(wss) ? outs.find(wss).OutputValue : false
let bucketURL = outs.find(bucket) ? outs.find(bucket).OutputValue : false
let url = cdnURL || apiURL || bucketURL
let cdnURL = outs?.find(cdn)?.OutputValue || false
let apiURL = outs?.find(api)?.OutputValue || false
let wssURL = outs?.find(wss)?.OutputValue || false
let bucketURL = outs?.find(bucket)?.OutputValue || false
let url = cdnURL || apiURL || bucketURL
let apiDomain = apiURL ? clean(apiURL) : false
let bucketDomain = bucketURL ? clean(bucketURL) : false
let httpDomain = outs.find(http) ? outs.find(http).OutputValue : false
let httpDomain = outs?.find(http)?.OutputValue || false

callback(null, { url, wssURL, apiDomain, bucketDomain, apigateway, s3, httpDomain })
}
Expand Down

0 comments on commit f4ff0c7

Please sign in to comment.