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
|
||||
|
||||
import (
|
||||
"discord-auto-upload/asset"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
@ -30,7 +31,13 @@ var wsConfig DAUWebServer
|
||||
// }
|
||||
|
||||
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) {
|
||||
@ -67,4 +74,5 @@ func startWebServer() {
|
||||
if err != nil {
|
||||
log.Fatal("ListenAndServe: ", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user