Skip to content
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

Fix the explanation on dot resource path #5338

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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