forked from tildetown/bbj2
make instance_info more closesly resemble spec
parent
3ed669f560
commit
d22be08044
|
@ -189,9 +189,19 @@ func writeErrorResponse(w http.ResponseWriter, code int, resp BBJResponse) {
|
||||||
|
|
||||||
func setupAPI(opts Opts) {
|
func setupAPI(opts Opts) {
|
||||||
|
|
||||||
http.HandleFunc("/instance", handler(opts, func(w http.ResponseWriter, req *http.Request) {
|
http.HandleFunc("/instance_info", handler(opts, func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
|
type instanceInfo struct {
|
||||||
|
InstanceName string `json:"instance_name"`
|
||||||
|
AllowAnon bool `json:"allow_anon"`
|
||||||
|
Admins []string
|
||||||
|
}
|
||||||
writeResponse(w, BBJResponse{
|
writeResponse(w, BBJResponse{
|
||||||
Data: opts.Config.InstanceName,
|
Data: instanceInfo{
|
||||||
|
InstanceName: opts.Config.InstanceName,
|
||||||
|
AllowAnon: opts.Config.AllowAnon,
|
||||||
|
Admins: opts.Config.Admins,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue