-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(standalone): support JSON format #12333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 35 commits
0fcff04
9cece82
d0b64a1
56663f2
fa91d38
510ed3e
21a8ae5
4352026
7e59f67
ac63edf
8ef41da
3b899b4
40900a7
4db06b9
2c9997c
33562c5
4725b2f
491a191
1d2aedf
9a18acd
ccc8e1c
b77b4d5
db6491e
0ec019d
d3890e3
d33703b
195a7d5
5e81920
67bae17
4bd3819
55ca345
62b3585
863d552
3ce58f5
0cf3e3d
3a79e7b
e67ef4a
81e2cc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ APISIX has three different deployment modes for different production use cases. | |
| |-----------------|----------------------------|---------------------------------------------------------------------------------------------------------------------| | ||
| | traditional | traditional | Data plane and control plane are deployed together. `enable_admin` attribute should be disabled manually. | | ||
| | decoupled | data_plane / control_plane | Data plane and control plane are deployed independently. | | ||
| | standalone | data_plane / traditional | The `data_plane` mode loads configuration from a local YAML file, while the traditional mode expects configuration through Admin API. | | ||
| | standalone | data_plane / traditional | The `data_plane` mode loads configuration from a local YAML / JSON file, while the traditional mode expects configuration through Admin API. | | ||
|
|
||
| Each of these deployment modes are explained in detail below. | ||
|
|
||
|
|
@@ -136,6 +136,8 @@ deployment: | |
|
|
||
| This makes it possible to disable the Admin API and discover configuration changes and reloads based on the local file system. | ||
|
|
||
| *Note*: When using `config_provider: yaml`, you can also provide the configuration in JSON format by placing it in `conf/apisix.json`. | ||
|
|
||
| #### API-driven (Experimental) | ||
|
|
||
| > This mode is experimental, please do not rely on it in your production environment. | ||
|
|
@@ -293,7 +295,7 @@ routes: | |
| #END | ||
| ``` | ||
|
|
||
| *WARNING*: APISIX will not load the rules into memory from file `conf/apisix.yaml` if there is no `#END` at the end. | ||
| *WARNING*: APISIX will not load the rules into memory from file `conf/apisix.yaml` if there is no `#END` at the end. However, when using `conf/apisix.json`, the `#END` marker is not required, as APISIX can directly parse and validate the JSON structure. | ||
AlinsRan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Environment variables can also be used like so: | ||
|
|
||
|
|
@@ -327,6 +329,23 @@ routes: | |
| #END | ||
| ``` | ||
|
|
||
| ```json5 | ||
| // JSON configuration can be directly translated from YAML, this is just an example. | ||
|
||
| { | ||
| "routes": [ | ||
| { | ||
| "uri": "/hello", | ||
| "upstream": { | ||
| "nodes": { | ||
| "127.0.0.1:1980": 1 | ||
| }, | ||
| "type": "roundrobin" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Multiple Routes: | ||
|
|
||
| ```yaml | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.