mirror of
https://github.com/darmiel/yaxc.git
synced 2025-09-08 15:34:29 +08:00
18 lines
238 B
Go
18 lines
238 B
Go
package api
|
|
|
|
import "github.com/spf13/viper"
|
|
|
|
type api struct {
|
|
ServerURL string
|
|
}
|
|
|
|
func API() *api {
|
|
server := viper.GetString("server")
|
|
if server == "" {
|
|
server = "http://127.0.0.1:1332"
|
|
}
|
|
|
|
return &api{
|
|
ServerURL: server,
|
|
}
|
|
}
|