feat: better example for the hook.
This commit is contained in:
parent
eaad1cbc06
commit
121e1470dc
1 changed files with 14 additions and 8 deletions
|
@ -10,6 +10,9 @@ import (
|
|||
)
|
||||
|
||||
type Context = bond.Context
|
||||
var (
|
||||
gclient *amo.Client
|
||||
)
|
||||
|
||||
var root = bond.Root(bond.Path().
|
||||
Def(
|
||||
|
@ -45,11 +48,6 @@ Def(
|
|||
))
|
||||
|
||||
func main() {
|
||||
srv := bond.Server{
|
||||
Addr: ":15080",
|
||||
Handler: root,
|
||||
}
|
||||
go srv.ListenAndServe()
|
||||
|
||||
opts := &amo.Options{
|
||||
Url: os.Getenv("AMO_URL"),
|
||||
|
@ -65,13 +63,21 @@ func main() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
gclient = client
|
||||
if pair != nil {
|
||||
fmt.Println("%q", pair)
|
||||
fmt.Println("PAIR: %q", pair)
|
||||
}
|
||||
|
||||
company, err := client.GetCompany("80699047", "")
|
||||
/*company, err := client.GetCompany("80699047", "")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}*/
|
||||
srv := bond.Server{
|
||||
Addr: ":15080",
|
||||
Handler: root,
|
||||
}
|
||||
err = srv.ListenAndServe()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(company)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue