status.go 528 Bytes
Newer Older
1 2 3 4
// Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

5 6 7 8
package debugapi

import (
	"net/http"
9

10
	"github.com/ethersphere/bee"
11
	"github.com/ethersphere/bee/pkg/jsonhttp"
12 13
)

14
type statusResponse struct {
15 16
	Status  string `json:"status"`
	Version string `json:"version"`
17 18
}

19
func (s *server) statusHandler(w http.ResponseWriter, r *http.Request) {
20
	jsonhttp.OK(w, statusResponse{
21 22
		Status:  "ok",
		Version: bee.Version,
23
	})
24
}