major refactoring of the api
This commit is contained in:
1 parent
d4f7dc57fc
commit
f0628e4682
38 files changed
+821
-367
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/didiercrunch/doormanserver/serverstat"
|
||||
"github.com/didiercrunch/doormanserver/shared"
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GetServerSpecification(w http.ResponseWriter, request *http.Request) {
|
||||
s := serverstat.Get(shared.GetParams())
|
||||
w.Header().Add("Content-Type", mime.TypeByExtension(".json"))
|
||||
encoder := json.NewEncoder(w)
|
||||
if err := encoder.Encode(s); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user