olive/config

Types

Holds all the important bits to run olive

pub type Config {
  Config(
    logger: logging.Logger,
    main_port: Int,
    proxy_port: Int,
    bind: String,
    root: String,
    name: String,
    dirs: List(Directory),
    debounce_in_ms: Int,
  )
}

Constructors

  • Config(
      logger: logging.Logger,
      main_port: Int,
      proxy_port: Int,
      bind: String,
      root: String,
      name: String,
      dirs: List(Directory),
      debounce_in_ms: Int,
    )

    Arguments

    main_port

    The main port needs to match the one listen by the main server

    proxy_port

    The proxy port is used by olive to create the web proxy server

    bind

    The bind address needs to match the one used by the main server and is used by the proxy to replicate the same behaviour

    root

    The root dir, where gleam.toml lives

    name

    The name of the project (field “name” in gleam.toml)

    dirs

    The list of dirs olive needs to watch to trigger live reload

    debounce_in_ms

    The debounce in ms to use for file watchers

pub type Directory {
  SourceDirectory(path: String)
  PrivDirectory(path: String)
}

Constructors

  • SourceDirectory(path: String)
  • PrivDirectory(path: String)

Values

pub fn read_config(
  logger: logging.Logger,
  options: cli.CliOptions,
) -> Result(Config, String)
Search Document