Getting tired
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
|
||||||
"fr.latosa-escrima/core"
|
"fr.latosa-escrima/core"
|
||||||
"fr.latosa-escrima/core/models"
|
"fr.latosa-escrima/core/models"
|
||||||
@@ -43,6 +44,9 @@ func HandleShortcode(w http.ResponseWriter, r *http.Request) {
|
|||||||
// Extract the host
|
// Extract the host
|
||||||
host := r.Host
|
host := r.Host
|
||||||
baseURL := fmt.Sprintf("%s://%s", scheme, host)
|
baseURL := fmt.Sprintf("%s://%s", scheme, host)
|
||||||
|
if os.Getenv("ENVIRONMENT") != "DEV" {
|
||||||
|
baseURL += "/api"
|
||||||
|
}
|
||||||
if shortcode.Media != nil {
|
if shortcode.Media != nil {
|
||||||
shortcode.Media.URL = fmt.Sprintf("%s/media/%s/file", baseURL, shortcode.Media.ID)
|
shortcode.Media.URL = fmt.Sprintf("%s/media/%s/file", baseURL, shortcode.Media.ID)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user