Moved radio/trains to regio43
This commit is contained in:
4
main.go
4
main.go
@@ -4,13 +4,13 @@ import (
|
||||
"net/http"
|
||||
"prettysunflower-website/keys"
|
||||
"prettysunflower-website/pages"
|
||||
"prettysunflower-website/radio"
|
||||
"prettysunflower-website/regio43"
|
||||
"prettysunflower-website/static"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pages.InitHttpHandlers()
|
||||
radio.InitHttpHandlers()
|
||||
regio43.InitHttpHandlers()
|
||||
static.InitHttpHandlers()
|
||||
keys.InitHttpHandlers()
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package radio
|
||||
package regio43
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -10,6 +9,5 @@ import (
|
||||
var content embed.FS
|
||||
|
||||
func InitHttpHandlers() {
|
||||
prefix := "/radio/"
|
||||
http.HandleFunc(fmt.Sprint(prefix, "trains"), trains)
|
||||
http.HandleFunc("/regio43/", trains)
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package radio
|
||||
package regio43
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>prettysunflower - The trains radio</title>
|
||||
<title>prettysunflower - Regio 43</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
|
||||
</head>
|
||||
<body class="page-radio-trains">
|
||||
@@ -11,7 +11,7 @@
|
||||
<video id="video-player" controls></video>
|
||||
</div>
|
||||
|
||||
<h1>The trains radio</h1>
|
||||
<h1>Regio 43</h1>
|
||||
|
||||
<main>
|
||||
{{ range .PlaylistItems }}
|
@@ -1,4 +1,4 @@
|
||||
package radio
|
||||
package regio43
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
@@ -16,14 +16,14 @@ func trains(w http.ResponseWriter, r *http.Request) {
|
||||
trainsPlaylist[i], trainsPlaylist[j] = trainsPlaylist[j], trainsPlaylist[i]
|
||||
})
|
||||
|
||||
templateFile := "templates/trains.tmpl"
|
||||
templateFile := "templates/regio43.tmpl"
|
||||
files, err := template.New(templateFile).ParseFS(content, templateFile)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
err = files.ExecuteTemplate(w, "trains.tmpl", TrainsTemplateData{
|
||||
err = files.ExecuteTemplate(w, "regio43.tmpl", TrainsTemplateData{
|
||||
PlaylistItems: trainsPlaylist,
|
||||
})
|
||||
|
Reference in New Issue
Block a user