🔨 Refactor URL handling logic and remove unused variables

This commit is contained in:
2024-03-07 15:32:38 +04:00
parent f7c4239163
commit a947b98acf
5 changed files with 16 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package httpHandlers
import (
"github.com/aykhans/oh-my-url/app/utils"
"github.com/aykhans/oh-my-url/app/config"
"html/template"
"net/http"
netUrl "net/url"
@@ -54,7 +55,7 @@ func (hl *HandlerCreate) UrlCreate(w http.ResponseWriter, r *http.Request) {
InternalServerError(w, err)
return
}
shortedURL, err := netUrl.JoinPath(hl.ForwardDomain, key)
shortedURL, err := netUrl.JoinPath(config.GetForwardDomain(), key)
if err != nil {
InternalServerError(w, err)
return