A Ballerina service’s structure and its semantics are defined by the service type, i.e. the type of listener attached. Let’s take a look at how a basic HTTP service is structured in Ballerina.
Service name: The service name represents the base path of the HTTP service. This is an optional value, where if it’s kept empty, the base path defaults to the value “/”.
Listener object: Provides an instance of http:Listener to bind to a specific host/port.
Resource: A resource represents a specific subpath that can be accessed in relation to the service base path.
#services #microservices #ballerina