← All procedures
server.start
Start CLI server as background daemon
CLI- Package
- @procedures/peer · README
- Path
["server","start"]- CLI
mark server start- As data
{"$proc":["server","start"],"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","start"], {});
console.log(JSON.stringify(result));From the command line
$ mark server start
As data, in a program
{ "$proc": ["server", "start"], "input": {} }Input
| Field | Type | Required | Default | Description |
|---|
port | integer | no | | The port to listen on (default: 3000) |
host | string | no | | The host to bind to (default: 127.0.0.1) |
transport | "http" | "websocket" | "both" | no | | The transport (default: http) |
Output
| Field | Type | Required | Default | Description |
|---|
success | boolean | yes | | True when the server started |
pid | number | no | | The process id of the server |
port | number | no | | The port of the server |
endpoint | string | no | | The URL of the server |
logFile | string | no | | The log file of the server |
message | string | yes | | A message about the result |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"port": {
"description": "The port to listen on (default: 3000)",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"host": {
"description": "The host to bind to (default: 127.0.0.1)",
"type": "string",
"minLength": 1
},
"transport": {
"description": "The transport (default: http)",
"type": "string",
"enum": [
"http",
"websocket",
"both"
]
}
}
},
"output": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "True when the server started"
},
"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"
},
"logFile": {
"description": "The log file of the server",
"type": "string"
},
"message": {
"type": "string",
"description": "A message about the result"
}
},
"required": [
"success",
"message"
],
"additionalProperties": {}
}
}