|
package main
|
|
|
|
import "net/http"
|
|
|
|
var apiConfig *Config
|
|
|
|
func withAPI(req *http.Request) {
|
|
if apiConfig == nil {
|
|
var err error
|
|
apiConfig, err = loadConfig()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
req.AddCookie(&http.Cookie{Name: "wasmcloud-token", Value: apiConfig.Token})
|
|
}
|