Skip to content

Getting started

The gateway is configured with one YAML file. Everything reusable is defined once under Rules, then referenced by name from the scope that needs it.

  1. Write a config. One backend, one route, and a rate limit bound to the route.

    gateway.yaml
    ApiVersion: v1Beta
    Rules:
    UsageControlRules:
    per-minute:
    RequestCount: 60
    WindowTime: 1m
    ServerConfigs:
    my-api:
    URL: "http://localhost:9090"
    ServerRoutes:
    api:
    TargetServer: my-api
    PathPattern: /api
    UsageControlRules: [per-minute]

    A request to /api/users is forwarded to http://localhost:9090/api/users, and each caller gets 60 requests per minute.

  2. Validate it. nocleye check reports errors and warnings without starting the gateway.

    Terminal window
    nocleye check --gConfigPath ./gateway.yaml

    See the check reference for every message.

  3. Run it.

    Terminal window
    nocleye gateway --gConfigPath ./gateway.yaml --gPort 8080

    Every flag has an environment variable, see Command line.