← All procedures

server.status

Get CLI server status

CLI
Package
@procedures/peer · README
Path
["server","status"]
CLI
mark server status
As data
{"$proc":["server","status"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/peer"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["server","status"], {});
console.log(JSON.stringify(result));

From the command line

$ mark server status

As data, in a program

{ "$proc": ["server", "status"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
portintegernoThe port of the server (default: all servers)

Output

FieldTypeRequiredDefaultDescription
runningbooleanyesTrue when a server runs
pidnumbernoThe process id of the server
portnumbernoThe port of the server
endpointstringnoThe URL of the server
transportstringnoThe transport of the server
startedAtstringnoThe start time (ISO 8601)
uptimestringnoThe time since the start, as text
logFilestringnoThe log file of the server
messagestringyesA message about the result
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "port": {
        "description": "The port of the server (default: all servers)",
        "type": "integer",
        "minimum": 1,
        "maximum": 65535
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "running": {
        "type": "boolean",
        "description": "True when a server runs"
      },
      "pid": {
        "description": "The process id of the server",
        "type": "number"
      },
      "port": {
        "description": "The port of the server",
        "type": "number"
      },
      "endpoint": {
        "description": "The URL of the server",
        "type": "string"
      },
      "transport": {
        "description": "The transport of the server",
        "type": "string"
      },
      "startedAt": {
        "description": "The start time (ISO 8601)",
        "type": "string"
      },
      "uptime": {
        "description": "The time since the start, as text",
        "type": "string"
      },
      "logFile": {
        "description": "The log file of the server",
        "type": "string"
      },
      "message": {
        "type": "string",
        "description": "A message about the result"
      }
    },
    "required": [
      "running",
      "message"
    ],
    "additionalProperties": {}
  }
}