Fixed URL bug
This commit is contained in:
parent
00c382de7f
commit
147b79eceb
@ -2,18 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (app *application) home(writer http.ResponseWriter, request *http.Request) {
|
func (app *application) home(writer http.ResponseWriter, request *http.Request) {
|
||||||
domain := request.Host
|
baseURI := request.Host
|
||||||
domainPieces := strings.Split(domain, ".")
|
|
||||||
var baseURI string
|
|
||||||
if len(domainPieces) > 1 {
|
|
||||||
baseURI = domainPieces[len(domainPieces) - 2] + domainPieces[len(domainPieces) - 1]
|
|
||||||
} else {
|
|
||||||
baseURI = domain
|
|
||||||
}
|
|
||||||
|
|
||||||
data := templateData{
|
data := templateData{
|
||||||
AppLinks: getAppLinks(app.tier, baseURI),
|
AppLinks: getAppLinks(app.tier, baseURI),
|
||||||
|
Loading…
Reference in New Issue
Block a user