Embedded assets
This commit is contained in:
parent
f976777f40
commit
e240f5dbd0
1
data/index.html
Normal file
1
data/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
THIS IS SPARTA
|
10
web/web.go
10
web/web.go
@ -1,6 +1,7 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"discord-auto-upload/asset"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
@ -30,7 +31,13 @@ var wsConfig DAUWebServer
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
func getIndex(w http.ResponseWriter, r *http.Request) {
|
func getIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintf(w, "index here")
|
data, err := asset.Asset("index.html")
|
||||||
|
if err != nil {
|
||||||
|
// Asset was not found.
|
||||||
|
fmt.Fprintln(w, err)
|
||||||
|
}
|
||||||
|
w.Write(data)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSetWebhook(w http.ResponseWriter, r *http.Request) {
|
func getSetWebhook(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -67,4 +74,5 @@ func startWebServer() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("ListenAndServe: ", err)
|
log.Fatal("ListenAndServe: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user