Nostalgic Primordial Monster

    traefik

    1.0.0 • Public • Published

    Node Traefik (traefik)

    Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy

    Use traefik as an npm module for tighter integration with node apps.

    Usage

    npm install traefik

    const traefik = require("traefik")
    
    // Path to YAML/TOML
    let service = await traefik.start("/path/to/traefik.yml")
    
    // Static Config Only
    service = await traefik.start({
      defaultEntryPoints: ["http"],
      entryPoints: {
        http: {
          address: ":3001",
        },
      },
      "log.level": "DEBUG",
    })
    
    // Long Form
    service = await traefik.start({
      log: true,
      staticConfig: {
        defaultEntryPoints: ["http"],
        entryPoints: {
          http: {
            address: ":3001",
          },
        },
        // dot notation is also OK!
        "log.level": "DEBUG",
      },
      dynamicConfig: {
        http: {
          routers: {
            someRouter: {
              service: "someService",
              rule: "PathPrefix(`/`)",
            },
          },
          services: {
            someService: {
              "loadBalancer.servers": [{ url: "http://localhost:3000" }],
            },
          },
        },
      },
    })
    
    await service.stop()

    Options

    See the traefik static configuration and dynamic configuration reference pages.

    Keywords

    none

    Install

    npm i traefik

    DownloadsWeekly Downloads

    4

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    14.9 kB

    Total Files

    14

    Last publish

    Collaborators

    • seveibar