Skip to content

Commit

Permalink
Merge pull request #115 from blinklabs-io/feat-update-qr-url
Browse files Browse the repository at this point in the history
feat: get host from a request
  • Loading branch information
verbotenj authored Nov 2, 2023
2 parents b06e56b + 74a2729 commit 82f6d82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions output/push/api_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func (p *PushOutput) RegisterRoutes() {
apiInstance := api.GetInstance()
var apiEndpoint string
if apiInstance.ApiGroup != nil {
apiEndpoint = apiInstance.Host + apiInstance.ApiGroup.BasePath() + "/fcm"
apiEndpoint = apiInstance.ApiGroup.BasePath() + "/fcm"
} else {
apiEndpoint = apiInstance.Host + "/fcm"
apiEndpoint = "/fcm"
}

apiInstance.AddRoute("POST", "/fcm", storeFCMToken)
Expand Down
1 change: 1 addition & 0 deletions output/push/qr_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type QRValue struct {

func generateQRPage(apiEndpoint string) gin.HandlerFunc {
return func(c *gin.Context) {
apiEndpoint = c.Request.Host + apiEndpoint
qrValue, err := json.Marshal(QRValue{
ApiEndpoint: apiEndpoint,
})
Expand Down

0 comments on commit 82f6d82

Please sign in to comment.