Shyne 现已登场更出色的演示、更优质的内容,还有更多精彩。探索 Shyne

System

Health and service-level endpoints.

API health check

Health endpoint used by Cloud Run probes and operators.

GET
/health

Response Body

API service is healthy.

TypeScript Definitions

Use the response body type in TypeScript.

okRequiredboolean

Whether the API service is healthy.

serviceRequiredstring

API service identifier.

timestampRequiredinteger

Unix timestamp in milliseconds.

curl -X GET "https://api.nextdocs.io/health"
fetch("https://api.nextdocs.io/health")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.nextdocs.io/health"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.nextdocs.io/health"

response = requests.request("GET", url)

print(response.text)
{
  "ok": true,
  "service": "nextdocs-api-stg",
  "timestamp": 1775126394291
}

Public API health check

Versioned health endpoint for the API service surface.

GET
/v1/health

Response Body

API service is healthy.

TypeScript Definitions

Use the response body type in TypeScript.

okRequiredboolean

Whether the API service is healthy.

serviceRequiredstring

API service identifier.

timestampRequiredinteger

Unix timestamp in milliseconds.

curl -X GET "https://api.nextdocs.io/v1/health"
fetch("https://api.nextdocs.io/v1/health")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.nextdocs.io/v1/health"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.nextdocs.io/v1/health"

response = requests.request("GET", url)

print(response.text)
{
  "ok": true,
  "service": "nextdocs-api-stg",
  "timestamp": 1775126394291
}