<%=
require 'yaml'

bpm = {
  "processes" => [
    { "name" => "routing-api",
      "executable" => "/var/vcap/packages/routing-api/bin/routing-api",
      "env" => {},
      "args" => [
        "-config",
        "/var/vcap/jobs/routing-api/config/routing-api.yml",
        "-logLevel",
        p("routing_api.log_level"),
        "-timeFormat",
        "rfc3339",
        "-ip",
        spec.ip,
      ],
      "hooks" => {
        "pre_start" => "/var/vcap/jobs/routing-api/bin/bpm-pre-start"
      }
    }
  ]
}

if p('routing_api.auth_disabled') == true
  bpm['processes'][0]['args'] << "-devMode"
end

YAML.dump(bpm)
%>
