Added beacon.html, with some refactor.

This commit is contained in:
2020-02-02 16:39:15 +08:00
parent d47c459406
commit d804dd98f6
6 changed files with 286 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package v1
import (
"encoding/json"
"fmt"
"git.eve.moe/jackyyf/navigator/api/beacon"
"git.eve.moe/jackyyf/navigator/mapping"
"git.eve.moe/jackyyf/navigator/mapping/firefly"
@ -42,7 +43,9 @@ func init() {
}
remoteIp := utils.GetRemoteIP(req)
go firefly.AddSpeedTestResult(remoteIp, request)
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(http.StatusOK)
fmt.Fprint(resp, "true")
})
beacon.RegisterApi("v1", serveMux)
}