Started to work on media upload and organization

This commit is contained in:
cdricms
2025-01-23 20:10:15 +01:00
parent f9dce4b40b
commit cdd8e34096
21 changed files with 1069 additions and 159 deletions

23
backend/utils/get_url.go Normal file
View File

@@ -0,0 +1,23 @@
package utils
import (
"fmt"
"net/http"
)
func GetURL(r *http.Request) string {
scheme := "http"
if r.TLS != nil { // Check if the request is over HTTPS
scheme = "https"
}
// Extract the host
host := r.Host
// Get the full request URI (path + query string)
fullPath := r.URL.Path
// Build the full request URL
return fmt.Sprintf("%s://%s%s", scheme, host, fullPath)
}