Skip to content

Commit

Permalink
Merge pull request #5338 from ballerina-platform/dot-resource-path-ma…
Browse files Browse the repository at this point in the history
…ster

Fix the explanation on dot resource path
  • Loading branch information
TharmiganK authored Jul 16, 2024
2 parents 17327e1 + 67eb38c commit 695ee31
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ table<Album> key(title) albums = table [
// It can be represented by both identifiers and string literals. E.g., `/music\-info`, `"/music-info"`.
service /info on new http:Listener(9090) {

// The `resource path` is `albums` and the `resource accessor` is `get`.
// The `.` represents the current resource that is `/info`.
// The `resource path` represents the relative path to the resource, and the `resource accessor`
// represents the HTTP method used to access the resource.
// Here, the resource path is `/albums`, and the resource accessor is `get`.
// This means the resource is invoked when an HTTP GET request is made to `/info/albums`.
// The `resource path` can be set as `.` to represent a resource with the `service path`
// that is `/info`.
resource function get albums() returns Album[] {
return albums.toArray();
}
Expand Down

0 comments on commit 695ee31

Please sign in to comment.