-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Docs should include JSON Examples #239
Comments
Yeah, I'd like to see more info on JSON docs too, but haven't really had time. For now, we do have a quick "Writing a Caddy JSON config from scratch" article in our community wiki which should hopefully get you started, at least. We try to avoid putting lots of examples in the official docs since there are so many possibilities that we can't guess what everyone needs, and we'd rather people read the docs, go through exercises, and understand what they are doing rather than copy-paste examples. But the wiki is a great place for community-contributed examples if you want to write some there! What is it about understanding the JSON that you find difficult? Instead of examples, maybe we should start from there. |
@mholt thank you for your reply. I can fully understand the time issues. Thank you for the pointer to the wiki. I will certainly have a closer look. Regarding the Caddyfile keywords in the docs, I think the JSON representation offers more than examples because a lot of features don't translate intuitively between the formats. E.g., the I just found that |
Where does it say that? In fact, the But yeah, directives don't necessarily map 1:1 with handlers. So even the
I guess we could do that, but the API is orthogonal to the Caddyfile. We introduce this command in the very first Getting Started guide that all users should be reading anyway. 👍 |
Thank you. Your comments help me to understand caddy better.
The first part was crystal clear to me. But the second part just became evident to me from the config translation but not from the
Without the corresponding JSON, it was quite difficult for me to understand this mapping. I was even looking for an
👍 I really like the API for pushing new parts of configurations to caddy as they appear in the environment. Getting the configuration of these sections right is just a much easier using the Caddyfile format.
I saw the However, with The docs on the command also don't state that My process is now: Caddyfile -> |
|
I kind of like the idea of showing the corresponding JSON somehow in the Caddyfile docs. Maybe optionally expandable. ( Francis is right though, |
@francislavoie @mholt thank you regarding |
I really enjoy working with the caddy admin API, but the documentation is not supportive at all. Currently, I have to submit a full Caddyfile to a test server in order to reverse engineer the logic of the JSON format of the different features.
For some reason the docs emphasise on the Caddyfile format, only. However, it is not possible to push partial Caddyfiles to the API because the admin API accepts only JSON documents. As for many features it is not at all clear where they should go in the JSON format, it would be really helpful to include basic JSON examples, too.
The text was updated successfully, but these errors were encountered: