initial chat server working
must send messages over javascript console for now
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func info(w http.ResponseWriter, req *http.Request) {
|
||||
logs.Debug("info")
|
||||
output := struct {
|
||||
Version string `json:"version"`
|
||||
}{
|
||||
Version: "0.0.0",
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(output)
|
||||
}
|
||||
|
||||
type authResp struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
Success bool `json:"success,omitempty"`
|
||||
Failure string `json:"failure,omitempty"`
|
||||
Admin bool `json:"admin,omitempty"`
|
||||
}
|
||||
|
||||
type authReq struct {
|
||||
Username string `json:"username"`
|
||||
}
|
||||
Reference in New Issue
Block a user