Couper Documentation

edge

Configuration File

The language for Couper’s configuration file is HCL 2.0, a configuration language by HashiCorp.

IDE Extension

Couper provides its own IDE extension that adds Couper-specific highlighting and autocompletion to Couper’s configuration file couper.hcl in Visual Studio Code.

Get it from the Visual Studio Market Place or visit the Extension repository.

File Name

The file-ending of your configuration file should be .hcl to have syntax highlighting within your IDE.

The file name defaults to couper.hcl in your working directory. This can be changed with the -f command-line flag. With -f /opt/couper/my_conf.hcl couper changes the working directory to /opt/couper and loads my_conf.hcl.

Basic File Structure

Couper’s configuration file consists of nested configuration blocks that configure the gateway. There are a large number of options, but let’s focus on the main structure first:

server "my_project" {
  files {
    # ...
  }

  spa {
    # ...
  }

  api {
    access_control = ["foo"]
    endpoint "/bar" {
      proxy {
        backend { }
      }
      request "sub-request" {
        backend { }
      }
      response { }
    }
  }
}

definitions {
  # ...
}

settings {
  # ...
}

defaults {
  # ...
}