JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q36416F
  • License MIT

langcode api server version

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (langpong) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    langpong

    langcode api server version

    Langpong CLI

    Langpong is a command-line interface tool designed to launch and configure the Langcode API Server. It supports flexible runtime configurations through CLI flags and external config files, making it easy to tailor deployments for various environments.


    ๐Ÿš€ Getting Started

    Installation

    npm install -g langpong

    Usage

    langpong [options]

    โš™๏ธ CLI Options

    Option Alias Description Default
    --config <path> -c Path to a JSON/YAML config file null
    --port <number> -p Port number for the API server process.env.PORT
    --host <string> -H Host/IP address process.env.HOST
    --maxConcurrentRunsPerManager Max parallel runs per plugin manager 3
    --maxConcurrentRunsGlobal Max parallel runs globally across all managers 10
    --logLevel <level> Logging level (info, debug, error) info

    ๐Ÿ“„ Configuration File

    You can optionally provide a configuration file using --config. It should be in JSON format and match the structure below:

    {
      "manager": {
        "maxConcurrentRunsPerManager": 3,
        "maxConcurrentRunsGlobal": 10,
        "maxIdleTimeMs": 600000,
        "maxLifeTimeMs": 3600000,
        "cleanupIntervalMs": 60000,
        "logsDir": "./logs",
        "logLevel": "info"
      },
      "server": {
        "port": 3000,
        "host": "127.0.0.1"
      },
      "pluginsDefault": []
    }

    Any CLI arguments will override the values provided in the configuration file.


    ๐Ÿง  Architecture Overview

    • ManagerStore: Handles plugin concurrency, lifecycle, and logging.
    • Langpong: Responsible for starting the HTTP server with specified host and port, and delegating tasks to the ManagerStore.
    • Deep Merge Strategy: Default config is extended first with the config file (if any), then finally overridden by CLI options.

    Run using:

    langpong -c ./config.json

    ๐Ÿงช Example

    langpong -p 8080 -H 0.0.0.0 --maxConcurrentRunsPerManager 5 --logLevel debug

    This command starts the server on port 8080, accessible on all interfaces, with concurrency and logging settings customized.

    ๐Ÿณ Docker Support

    Pull from Docker Hub

    docker pull yourdockerhubusername/langpong:latest

    Run Manually

    docker run -p 3000:3000 yourdockerhubusername/langpong:latest \
      --config /app/config.json

    To mount a config file:

    docker run -p 3000:3000 \
      -v $(pwd)/config.json:/app/config.json \
      yourdockerhubusername/langpong:latest \
      --config /app/config.json

    ๐Ÿงฑ Docker Compose Example

    Create a docker-compose.yml file like this:

    version: '3.8'
    
    services:
      langpong:
        image: yourdockerhubusername/langpong:latest
        container_name: langpong-server
        ports:
          - "3000:3000"
        volumes:
          - ./config.json:/app/config.json:ro
        command: ["--config", "/app/config.json"]
        restart: unless-stopped
        environment:
          - LOG_LEVEL=debug

    ๐Ÿ“ฆ Version

    Current Version: 1.0.3


    ๐Ÿ“ง Support

    For bug reports, suggestions, or feature requests, please open an issue on the GitHub repository.


    ๐Ÿ“ License

    MIT License. See LICENSE file for details.