Skip to content

Begin typing to search this documentation.

hoplite.internal

Internal Unstable

Internal interfaces are visible for advanced hosting and implementation inspection. They are not a compatibility commitment.

Use hoplite.core/app for the normal single-application case. Use this namespace only when one generated Nginx configuration must host several declared apps.

(config definition)

Defines an advanced single- or multi-application host configuration by associating :hoplite/type :config with the supplied map.

(ns example.host
(:require [example.api :as api]
[example.admin :as admin]
[hoplite.internal :as internal]))
(def config
(internal/config
{:worker-processes 4
:apps [{:id :api
:app #'api/app
:port 8080
:hostnames ["api.example.test"]}
{:id :admin
:app #'admin/app
:port 8081
:hostnames ["admin.example.test"]}]}))
;; => the supplied map with :hoplite/type :config

Point the selected profile’s :profile/main at example.host/config, not at either child application.

config itself only associates :hoplite/type :config; the build validates the consumed definition. Worker counts must be positive, app IDs and listener ownership must be unambiguous, app references must be Vars, ports must be valid, and hostnames must not create conflicting routes. Treat those build errors as configuration errors rather than attempting to resolve ownership at runtime.

See Multiple applications for the complete instance fields and validation rules.

Source: core/lib/src/hoplite/internal.hal