Servers
Define server URLs and protocols to help users connect to your event-driven API.
AsyncAPI allows you to specify one or more server configurations under the servers
key.
asyncapi.yml
Specifying servers is valuable for both SDKs and Docs:
- For SDKs, your users won’t need to manually specify the server URL at client instantiation
- For Docs, your API playground will automatically connect to the correct server
Protocol support
AsyncAPI supports various protocols for event-driven communication:
asyncapi.yml
Naming your servers
We recommend giving your servers descriptive names to make it clear what each server is for:
asyncapi.yml
Server variables
You can use variables in your server configurations to make them more flexible:
asyncapi.yml
Multiple protocols for different channels
If you have different channels that use different protocols, you can specify this in your server configuration:
asyncapi.yml
This allows different channels to use the most appropriate protocol for their use case.