fleet/server/service/transport_setup.go
Victor Vrantchan ac14215e21 create first time setup endpoint (#436)
The endpoint is only active if there are no users in the datastore.
While the endpoint is active, it also disables all the other API endpoints, and /config returns `{"require_setup":true}`
for #378
2016-11-09 12:19:07 -05:00

17 lines
296 B
Go

package service
import (
"encoding/json"
"net/http"
"golang.org/x/net/context"
)
func decodeSetupRequest(ctx context.Context, r *http.Request) (interface{}, error) {
var req setupRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, err
}
return req, nil
}