summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorLiam Crilly <liam.crilly@nginx.com>2023-10-02 09:43:57 +0100
committerLiam Crilly <liam.crilly@nginx.com>2023-10-02 09:43:57 +0100
commit7fac9087424e1f7c4b82bfb8426aca197f1f8904 (patch)
treefde233d23cffbdb0a2bcc4b63c2aeb5c69b67543 /src
parentb6216f0bb7c4e10afcec00c6660644ff32db0dfb (diff)
downloadunit-7fac9087424e1f7c4b82bfb8426aca197f1f8904.tar.gz
unit-7fac9087424e1f7c4b82bfb8426aca197f1f8904.tar.bz2
Added routes array to the default configuration.
The default configuration previously contained just a listeners and applications object. Since routes is now a principle configuration object, and a recommended way of configurating Unit, it is now included in the default configuration. This change benefits new users because it explicitly introduces the three principle configuration objects which leads more intuitively to the documentation. Experienced users may choose to ignore or delete routes. routes is defined as an array instead of an object because this change is designed to assist new users, where the simpler form of routes is easier to understand.
Diffstat (limited to 'src')
-rw-r--r--src/nxt_controller.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index 4e2e3749..eb814321 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -510,8 +510,9 @@ nxt_controller_conf_default(void)
nxt_mp_t *mp;
nxt_conf_value_t *conf;
- static const nxt_str_t json
- = nxt_string("{ \"listeners\": {}, \"applications\": {} }");
+ static const nxt_str_t json = nxt_string(
+ "{ \"listeners\": {}, \"routes\": [], \"applications\": {} }"
+ );
mp = nxt_mp_create(1024, 128, 256, 32);